[Bf-blender-cvs] [b8be0557a74] master: Fix noisy GFlags warnings when building tests
Sergey Sharybin
noreply at git.blender.org
Mon Sep 2 09:42:57 CEST 2019
Commit: b8be0557a74dda9f78fde127212c18a3bec4f788
Author: Sergey Sharybin
Date: Wed Aug 28 16:30:39 2019 +0200
Branches: master
https://developer.blender.org/rBb8be0557a74dda9f78fde127212c18a3bec4f788
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.
===================================================================
M build_files/cmake/Modules/GTestTesting.cmake
===================================================================
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>)
More information about the Bf-blender-cvs
mailing list