Disable Clang's return-type-c-linkage warning (#3227)
* Disable return-type-c-linkage warning on Clang. This is emitted by the compiler when it can't tell if the incomplete type being returned is a C++ type, which might not have a C-compatible layout. In `taskchampion.h`, the types are not C++ types so this is not an issue and the warning is unnecessary. * Use an if instead Fancy generator expressions appear to not work. * Try some different CMake syntax
This commit is contained in:
committed by
GitHub
parent
b515f876ca
commit
80047ad5e7
@@ -125,6 +125,11 @@ if (SOLARIS)
|
|||||||
endif (NSL_LIBRARY)
|
endif (NSL_LIBRARY)
|
||||||
endif (SOLARIS)
|
endif (SOLARIS)
|
||||||
|
|
||||||
|
# Disable the Clang return-type-c-linkage warning globally. See #3225.
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
|
||||||
|
endif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||||
|
|
||||||
message ("-- Configuring cmake.h")
|
message ("-- Configuring cmake.h")
|
||||||
configure_file (
|
configure_file (
|
||||||
${CMAKE_SOURCE_DIR}/cmake.h.in
|
${CMAKE_SOURCE_DIR}/cmake.h.in
|
||||||
|
|||||||
Reference in New Issue
Block a user