commit 864dd102123f48c09d6183d1002363a199dfe48d
parent c83d5e6435caecc2238250fb6d8c9d5a6ce3dd7b
Author: Johannes Lorenz <johannes89@ist-einmalig.de>
Date: Sun, 16 Oct 2016 18:33:46 +0200
Suppress errors from system headers. Add build passed immage.
Diffstat:
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/README.adoc b/README.adoc
@@ -1,5 +1,8 @@
ZynAddSubFX
-----------
+
+image::https://travis-ci.org/zynaddsubfx/zynaddsubfx.svg?branch=master[alt="Build status", link="https://travis-ci.org/zynaddsubfx/zynaddsubfx"]
+
It is a feature heavy realtime software synthesizer for Linux, OSX,
and Windows.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -262,12 +262,33 @@ add_definitions(
-Wextra
)
-CHECK_CXX_COMPILER_FLAG(-Wno-inconsistent-missing-override
- COMPILER_SUPPORTS_OVERRIDE)
-if(COMPILER_SUPPORTS_OVERRIDE)
+# macro similar to "check_cxx_compiler_flag_extra", however,
+# it also checks for warnings that are only output if other warnings are active
+macro (check_cxx_compiler_flag_extra _FLAG _FAILREGEX _RESULT)
+ set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
+ set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+
+ check_cxx_source_compiles("int main() { int x; return x; }" ${_RESULT}
+ FAIL_REGEX "unrecognized|option"
+ )
+
+ set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+endmacro ()
+
+check_cxx_compiler_flag_extra("-Wall -Wextra -Wno-inconsistent-missing-override"
+ "unrecognized|option"
+ COMPILER_SUPPORTS_NO_INCONSISTENT_MISSING_OVERRIDE
+ )
+if(COMPILER_SUPPORTS_NO_INCONSISTENT_MISSING_OVERRIDE)
add_definitions(-Wno-inconsistent-missing-override)
endif()
+check_cxx_compiler_flag("-Wall -Wextra -Werror --system-header-prefix='FL/'"
+ COMPILER_SUPPORTS_SYSTEM_HDR_PREFIX)
+if(COMPILER_SUPPORTS_SYSTEM_HDR_PREFIX)
+ add_definitions(--system-header-prefix="FL/")
+endif()
+
if(NOT AVOID_ASM)
message(STATUS "Compiling with x86 opcode support")
add_definitions(-DASM_F2I_YES)