forked from OSchip/llvm-project
[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@llvm.org> llvm-svn: 322376
This commit is contained in:
parent
e0d2f7678d
commit
21de8adc36
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -75,14 +75,14 @@ set_target_properties(PollyCore PROPERTIES FOLDER "Polly")
|
|||
# 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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue