summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddLLVM.cmake4
-rw-r--r--cmake/modules/LLVM-Config.cmake4
2 files changed, 4 insertions, 4 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 26da2d13eed..90cba50d94c 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -768,7 +768,7 @@ macro(add_llvm_executable name)
# libpthreads overrides some standard library symbols, so main
# executable must be linked with it in order to provide consistent
# API for all shared libaries loaded by this executable.
- target_link_libraries(${name} ${LLVM_PTHREAD_LIB})
+ target_link_libraries(${name} PRIVATE ${LLVM_PTHREAD_LIB})
endif()
endmacro(add_llvm_executable name)
@@ -1093,7 +1093,7 @@ function(add_unittest test_suite test_name)
# libpthreads overrides some standard library symbols, so main
# executable must be linked with it in order to provide consistent
# API for all shared libaries loaded by this executable.
- target_link_libraries(${test_name} gtest_main gtest ${LLVM_PTHREAD_LIB})
+ target_link_libraries(${test_name} PRIVATE gtest_main gtest ${LLVM_PTHREAD_LIB})
add_dependencies(${test_suite} ${test_name})
get_target_property(test_suite_folder ${test_suite} FOLDER)
diff --git a/cmake/modules/LLVM-Config.cmake b/cmake/modules/LLVM-Config.cmake
index 9cce1a2d4bc..10fd5260927 100644
--- a/cmake/modules/LLVM-Config.cmake
+++ b/cmake/modules/LLVM-Config.cmake
@@ -87,7 +87,7 @@ macro(llvm_config executable)
endif()
endif()
- target_link_libraries(${executable} LLVM)
+ target_link_libraries(${executable} PRIVATE LLVM)
endif()
explicit_llvm_config(${executable} ${link_components})
@@ -101,7 +101,7 @@ function(explicit_llvm_config executable)
get_target_property(t ${executable} TYPE)
if(t STREQUAL "STATIC_LIBRARY")
target_link_libraries(${executable} INTERFACE ${LIBRARIES})
- elseif(t STREQUAL "SHARED_LIBRARY" OR t STREQUAL "MODULE_LIBRARY")
+ elseif(t STREQUAL "EXECUTABLE" OR t STREQUAL "SHARED_LIBRARY" OR t STREQUAL "MODULE_LIBRARY")
target_link_libraries(${executable} PRIVATE ${LIBRARIES})
else()
# Use plain form for legacy user.