MSVC: expand C99's `inline` to MSVC's `__inline`.
This is not done for C++ as C++ has a proper inline keyword, and MSVC's C++ standard library will not like it becoming a macro.pull/4/merge
parent
ae60187322
commit
3bdaa53725
|
@ -45,6 +45,13 @@ if(WIN32)
|
||||||
-D_UNICODE)
|
-D_UNICODE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
# Many versions of MSVC do not have the (C99) inline keyword, instead
|
||||||
|
# they have their own __inline; this breaks `static inline` functions.
|
||||||
|
# We do not want to care and so we fix this with a definition.
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
set(WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter")
|
set(WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||||
|
|
Loading…
Reference in New Issue