[PATCH] D33444: Fix an issue of creating symlinks when llvm is embedded

Vassil Vassilev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 08:07:16 PDT 2017


v.g.vassilev created this revision.
Herald added a subscriber: mgorny.

We configure with llvm with a script not from the command line. When trying to create a symlink we try to get a value from target property `RUNTIME_OUTPUT_DIRECTORY_RELEASE` which is only conditionally set (see `set_output_directory`).

Adjust the condition to match the conditional addition in ``set_output_directory`.


Repository:
  rL LLVM

https://reviews.llvm.org/D33444

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -200,7 +200,7 @@
 
 # Set each output directory according to ${CMAKE_CONFIGURATION_TYPES}.
 # Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more,
-# or a certain builder, for eaxample, msbuild.exe, would be confused.
+# or a certain builder, for example, msbuild.exe, would be confused.
 function(set_output_directory target)
   cmake_parse_arguments(ARG "" "BINARY_DIR;LIBRARY_DIR" "" ${ARGN})
 
@@ -1322,20 +1322,21 @@
     if(UNIX)
       set(dest_binary "$<TARGET_FILE_NAME:${target}>")
     endif()
-    if(CMAKE_CONFIGURATION_TYPES)
+    if(CMAKE_CONFIGURATION_TYPES AND NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
       list(GET CMAKE_CONFIGURATION_TYPES 0 first_type)
       string(TOUPPER ${first_type} first_type_upper)
       set(first_type_suffix _${first_type_upper})
     endif()
+
     get_target_property(target_type ${target} TYPE)
     if(${target_type} STREQUAL "STATIC_LIBRARY")
       get_target_property(ARG_OUTPUT_DIR ${target} ARCHIVE_OUTPUT_DIRECTORY${first_type_suffix})
     elseif(UNIX AND ${target_type} STREQUAL "SHARED_LIBRARY")
       get_target_property(ARG_OUTPUT_DIR ${target} LIBRARY_OUTPUT_DIRECTORY${first_type_suffix})
     else()
       get_target_property(ARG_OUTPUT_DIR ${target} RUNTIME_OUTPUT_DIRECTORY${first_type_suffix})
     endif()
-    if(CMAKE_CONFIGURATION_TYPES)
+    if(CMAKE_CONFIGURATION_TYPES AND NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
       string(FIND "${ARG_OUTPUT_DIR}" "/${first_type}/" type_start REVERSE)
       string(SUBSTRING "${ARG_OUTPUT_DIR}" 0 ${type_start} path_prefix)
       string(SUBSTRING "${ARG_OUTPUT_DIR}" ${type_start} -1 path_suffix)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33444.99915.patch
Type: text/x-patch
Size: 1794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170523/281653e8/attachment.bin>


More information about the llvm-commits mailing list