浏览代码

CMake: Disable -Werror for Unity

Max Bruckner 8 年之前
父节点
当前提交
40e3781e9b
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      tests/CMakeLists.txt

+ 7 - 0
tests/CMakeLists.txt

@@ -1,6 +1,13 @@
 add_library(unity unity/src/unity.c)
 
 if(ENABLE_CJSON_TEST)
+
+    # Disable -Werror for Unity
+    list(FIND custom_compiler_flags "-Werror" werror_found)
+    if (werror_found)
+        target_compile_options(unity PRIVATE "-Wno-error")
+    endif()
+
     #copy test files
     file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inputs")
     file(GLOB test_files "inputs/*")