提交 2f712c74 编写于 作者: M Max Bruckner

CMake: Fix compile flag detection on old CMake

上级 d00ca18a
...@@ -33,7 +33,6 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS) ...@@ -33,7 +33,6 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
-Wmissing-prototypes -Wmissing-prototypes
-Wstrict-overflow=2 -Wstrict-overflow=2
-Wcast-qual -Wcast-qual
-Wc++-compat
-Wundef -Wundef
-Wswitch-default -Wswitch-default
-Wconversion -Wconversion
...@@ -41,6 +40,14 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS) ...@@ -41,6 +40,14 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
) )
endif() endif()
# "I am starting to hate CMake" - FSMaxB
# In older versions of CMake, testing for -Wc++-compat
# fails because it cannot compile a regular expression
# This seems to be a bug in the CheckCSourceCompiles module
if (NOT (CMAKE_MAJOR_VERSION EQUAL 2))
list(APPEND custom_compiler_flags "-Wc++-compat")
endif()
# apply custom compiler flags # apply custom compiler flags
foreach(compiler_flag ${custom_compiler_flags}) foreach(compiler_flag ${custom_compiler_flags})
CHECK_C_COMPILER_FLAG(${compiler_flag} "FLAG_SUPPORTED-${compiler_flag}") CHECK_C_COMPILER_FLAG(${compiler_flag} "FLAG_SUPPORTED-${compiler_flag}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册