[polly] r322376 - [CMake] Use only keyword-version of target_link_library. NFC.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 12 08:09:18 PST 2018
Author: meinersbur
Date: Fri Jan 12 08:09:18 2018
New Revision: 322376
URL: http://llvm.org/viewvc/llvm-project?rev=322376&view=rev
Log:
[CMake] Use only keyword-version of target_link_library. NFC.
CMake insists that for each target, one uses only the non-keyword
version of target_link_library
target_link_library(mytarget lib)
or the one with PUBLIC/PRIVATE/INTERFACE keyword:
target_link_library(mytarget PUBLIC lib)
Otherwise, CMake fails with the error message:
The keyword signature for target_link_libraries has already been used with
the target "mytarget". All uses of target_link_libraries with a target
must be either all-keyword or all-plain.
Change all occurances of target_link_library to the newer keyworded
version to avoid such errors. Some already have been changed in r319840,
but might not be sufficient for all build configurations to build
the doxygen manual.
Reported-by: Tanya Lattner <tanyalattner at llvm.org>
Modified:
polly/trunk/CMakeLists.txt
polly/trunk/cmake/polly_macros.cmake
polly/trunk/lib/CMakeLists.txt
polly/trunk/lib/External/CMakeLists.txt
Modified: polly/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/CMakeLists.txt?rev=322376&r1=322375&r2=322376&view=diff
==============================================================================
--- polly/trunk/CMakeLists.txt (original)
+++ polly/trunk/CMakeLists.txt Fri Jan 12 08:09:18 2018
@@ -49,10 +49,10 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
"${UNITTEST_DIR}/googletest"
"${UNITTEST_DIR}/googlemock"
)
- target_link_libraries(gtest -lpthread)
+ target_link_libraries(gtest PUBLIC -lpthread)
add_library(gtest_main ${UNITTEST_DIR}/UnitTestMain/TestMain.cpp)
- target_link_libraries(gtest_main gtest)
+ target_link_libraries(gtest_main PUBLIC gtest)
set(POLLY_GTEST_AVAIL 1)
endif()
Modified: polly/trunk/cmake/polly_macros.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/polly_macros.cmake?rev=322376&r1=322375&r2=322376&view=diff
==============================================================================
--- polly/trunk/cmake/polly_macros.cmake (original)
+++ polly/trunk/cmake/polly_macros.cmake Fri Jan 12 08:09:18 2018
@@ -28,13 +28,13 @@ macro(add_polly_library name)
endif( LLVM_COMMON_DEPENDS )
if( LLVM_USED_LIBS )
foreach(lib ${LLVM_USED_LIBS})
- target_link_libraries( ${name} ${lib} )
+ target_link_libraries( ${name} PUBLIC ${lib} )
endforeach(lib)
endif( LLVM_USED_LIBS )
if(POLLY_LINK_LIBS)
foreach(lib ${POLLY_LINK_LIBS})
- target_link_libraries(${name} ${lib})
+ target_link_libraries(${name} PUBLIC ${lib})
endforeach(lib)
endif(POLLY_LINK_LIBS)
Modified: polly/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CMakeLists.txt?rev=322376&r1=322375&r2=322376&view=diff
==============================================================================
--- polly/trunk/lib/CMakeLists.txt (original)
+++ polly/trunk/lib/CMakeLists.txt Fri Jan 12 08:09:18 2018
@@ -75,14 +75,14 @@ set_target_properties(PollyCore PROPERTI
# LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
# well.
add_polly_library(Polly $<TARGET_OBJECTS:PollyCore>)
-target_link_libraries(Polly
+target_link_libraries(Polly PUBLIC
${ISL_TARGET}
${JSONCPP_LIBRARIES}
)
# Additional dependencies for Polly-ACC.
if (GPU_CODEGEN)
- target_link_libraries(Polly PollyPPCG)
+ target_link_libraries(Polly PUBLIC PollyPPCG)
endif ()
@@ -100,9 +100,9 @@ if (LLVM_LINK_LLVM_DYLIB)
# (their LLVM*.a/so and their copies in libLLVM.so)
# which results in errors when the two instances try to register the same
# command-line switches.
- target_link_libraries(Polly LLVM)
+ target_link_libraries(Polly PUBLIC LLVM)
else ()
- target_link_libraries(Polly
+ target_link_libraries(Polly PUBLIC
LLVMSupport
LLVMCore
LLVMScalarOpts
@@ -145,9 +145,9 @@ else ()
# hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
# instead which will automatically resolve the additional dependencies by
# Polly.
- target_link_libraries(LLVMPolly ${ISL_TARGET} ${JSONCPP_LIBRARIES})
+ target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET} ${JSONCPP_LIBRARIES})
if (GPU_CODEGEN)
- target_link_libraries(LLVMPolly PollyPPCG)
+ target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
endif ()
set_target_properties(LLVMPolly
Modified: polly/trunk/lib/External/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/CMakeLists.txt?rev=322376&r1=322375&r2=322376&view=diff
==============================================================================
--- polly/trunk/lib/External/CMakeLists.txt (original)
+++ polly/trunk/lib/External/CMakeLists.txt Fri Jan 12 08:09:18 2018
@@ -281,7 +281,7 @@ if (POLLY_BUNDLED_ISL)
)
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly")
- target_link_libraries(polly-isl-test
+ target_link_libraries(polly-isl-test PRIVATE
PollyISL
)
@@ -342,7 +342,7 @@ add_polly_library(PollyPPCG
${PPCG_FILES}
)
-target_link_libraries(PollyPPCG ${ISL_TARGET})
+target_link_libraries(PollyPPCG PUBLIC ${ISL_TARGET})
# Disable warnings for upstream projects.
if (MSVC)
More information about the llvm-commits
mailing list