diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-08-28 17:30:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-02 10:42:44 +0300 |
commit | b8be0557a74dda9f78fde127212c18a3bec4f788 (patch) | |
tree | 0d72b8c7b4699e306bb2d12ce63414af503a3b42 /build_files/cmake | |
parent | 2c68d50421134d0522e7f5ee24c6ecaeceec6d75 (diff) |
Fix noisy GFlags warnings when building tests
Split include directories into regular and system ones, which
makes it so strict flags are properly cancelled out for GFlags
headers.
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/Modules/GTestTesting.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index 0327a369f0a..e1001f25d7a 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -20,6 +20,8 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST) set(TEST_INC ${_current_include_directories} ${CMAKE_SOURCE_DIR}/tests/gtests + ) + set(TEST_INC_SYS ${GLOG_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/extern/gtest/include @@ -28,6 +30,8 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST) unset(_current_include_directories) add_executable(${NAME}_test ${SRC}) + target_include_directories(${NAME}_test PUBLIC "${TEST_INC}") + target_include_directories(${NAME}_test SYSTEM PUBLIC "${TEST_INC_SYS}") target_link_libraries(${NAME}_test ${EXTRA_LIBS} ${PLATFORM_LINKLIBS} @@ -46,8 +50,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST) set_target_properties(${NAME}_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}" RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}" - INCLUDE_DIRECTORIES "${TEST_INC}") + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}") if(${DO_ADD_TEST}) add_test(NAME ${NAME}_test COMMAND ${TESTS_OUTPUT_DIR}/${NAME}_test WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>) |