mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[cmake] Make gtest include directories a part of the library interface
This applies the same fix that D84748 did for macro definitions. Appropriate include path is now automatically set for all libraries which link against gtest targets, which avoids the need to set include_directories in various parts of the project. Differential Revision: https://reviews.llvm.org/D86616
This commit is contained in:
parent
65b0561260
commit
e258c2d84b
@ -1401,9 +1401,6 @@ function(add_unittest test_suite test_name)
|
||||
set(EXCLUDE_FROM_ALL ON)
|
||||
endif()
|
||||
|
||||
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
|
||||
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
|
||||
|
||||
if (SUPPORTS_VARIADIC_MACROS_FLAG)
|
||||
list(APPEND LLVM_COMPILE_FLAGS "-Wno-variadic-macros")
|
||||
endif ()
|
||||
|
@ -12,6 +12,4 @@ add_llvm_library(LLVMTestingSupport
|
||||
Support
|
||||
)
|
||||
|
||||
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
|
||||
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
|
||||
target_link_libraries(LLVMTestingSupport PRIVATE gtest)
|
||||
|
@ -11,14 +11,6 @@
|
||||
#
|
||||
# Project-wide settings
|
||||
|
||||
# Where gtest's .h files can be found.
|
||||
include_directories(
|
||||
googletest/include
|
||||
googletest
|
||||
googlemock/include
|
||||
googlemock
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DGTEST_OS_WINDOWS=1)
|
||||
endif()
|
||||
@ -76,6 +68,11 @@ if (NOT LLVM_ENABLE_THREADS)
|
||||
target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0)
|
||||
endif ()
|
||||
|
||||
target_include_directories(gtest
|
||||
PUBLIC googletest/include googlemock/include
|
||||
PRIVATE googletest googlemock
|
||||
)
|
||||
|
||||
add_subdirectory(UnitTestMain)
|
||||
|
||||
# When LLVM_LINK_LLVM_DYLIB is enabled, libLLVM.so is added to the interface
|
||||
|
Loading…
Reference in New Issue
Block a user