[polly] r346231 - [CMake] Fix generation of exported targets in build directory

Philip Pfaffe via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 07:18:17 PST 2018


Author: pfaffe
Date: Tue Nov  6 07:18:17 2018
New Revision: 346231

URL: http://llvm.org/viewvc/llvm-project?rev=346231&view=rev
Log:
[CMake] Fix generation of exported targets in build directory

CMake generates the exports file wrongly if the CMAKE_BUILD_TYPE is
unset for multi-configuration generators.

The generated file lib/cmake/polly/PollyExports-all.cmake then contains:

set_target_properties(LLVMPolly PROPERTIES
              IMPORTED_LOCATION_ my_build_dir/lib/LLVMPolly.so)
set_target_properties(Polly PROPERTIES
              IMPORTED_LOCATION_ my_build_dir/lib/libPolly.a)

This patch conditionalizes the underscore.

Patch by: Marcin Copik

Differential Revision: D53376

Modified:
    polly/trunk/cmake/CMakeLists.txt

Modified: polly/trunk/cmake/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/CMakeLists.txt?rev=346231&r1=346230&r2=346231&view=diff
==============================================================================
--- polly/trunk/cmake/CMakeLists.txt (original)
+++ polly/trunk/cmake/CMakeLists.txt Tue Nov  6 07:18:17 2018
@@ -60,7 +60,7 @@ foreach(tgt IN LISTS POLLY_CONFIG_EXPORT
   if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
     set(POLLY_EXPORTS
       "set_target_properties(${tgt} PROPERTIES
-              IMPORTED_LOCATION_$<UPPER_CASE:$<CONFIG>> $<TARGET_FILE:${tgt}>)
+              IMPORTED_LOCATION$<$<NOT:$<CONFIG:>>:_$<UPPER_CASE:$<CONFIG>>> $<TARGET_FILE:${tgt}>)
 ${POLLY_EXPORTS}")
   endif()
 endforeach(tgt)
@@ -111,7 +111,7 @@ foreach(tgt IN LISTS POLLY_CONFIG_EXPORT
   if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
     set(POLLY_EXPORTS
 "set_target_properties(${tgt} PROPERTIES
-        IMPORTED_LOCATION$<$<NOT:$<CONFIG:>>:_<UPPER_CASE:$<CONFIG>> \${CMAKE_CURRENT_LIST_DIR}/${tgt_path})
+        IMPORTED_LOCATION$<$<NOT:$<CONFIG:>>:_$<UPPER_CASE:$<CONFIG>>> \${CMAKE_CURRENT_LIST_DIR}/${tgt_path})
 ${POLLY_EXPORTS}")
   endif()
 endforeach(tgt)




More information about the llvm-commits mailing list