llvm.org GIT mirror llvm / 071f23b
[CMake] Set per-runtime library directory suffix in runtimes build Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal variable used by the runtimes build from individual runtimes, instead set per-runtime librarhy directory suffix variable which is necessary for the sanitized runtimes build to install libraries into correct location. Differential Revision: https://reviews.llvm.org/D49121 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336713 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 1 year, 2 months ago
1 changed file(s) with 4 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
119119 set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS})
120120 set(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES})
121121
122 if(NOT LLVM_RUNTIMES_PREFIX)
123 set(LLVM_RUNTIMES_PREFIX "${LLVM_RUNTIMES_TARGET}/")
124 endif()
125
126 string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
127 ${PACKAGE_VERSION})
128
129122 foreach(entry ${runtimes})
130123 get_filename_component(projName ${entry} NAME)
131124
135128 # The subdirectories need to treat this as standalone builds
136129 set(${canon_name}_STANDALONE_BUILD On)
137130
131 if(LLVM_RUNTIMES_LIBDIR_SUFFIX)
132 set(${canon_name}_LIBDIR_SUFFIX "${LLVM_RUNTIMES_LIBDIR_SUFFIX}" CACHE STRING "" FORCE)
133 endif()
134
138135 # Setting a variable to let sub-projects detect which other projects
139136 # will be included under here.
140137 set(HAVE_${canon_name} On)
141138 endforeach()
142
143 set(SAFE_LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
144 set(SAFE_LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
145 set(SAFE_LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
146139
147140 # We do this in two loops so that HAVE_* is set for each runtime before the
148141 # other runtimes are added.
166159 list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS})
167160 list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS})
168161 list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS})
169
170 if(LLVM_RUNTIMES_TARGET)
171 if(NOT "${projName}" MATCHES "compiler-rt")
172 set(LLVM_BINARY_DIR "${SAFE_LLVM_BINARY_DIR}")
173 set(LLVM_LIBRARY_OUTPUT_INTDIR "${SAFE_LLVM_LIBRARY_OUTPUT_INTDIR}")
174 set(LLVM_RUNTIME_OUTPUT_INTDIR "${SAFE_LLVM_RUNTIME_OUTPUT_INTDIR}")
175 endif()
176 endif()
177162 endforeach()
178163
179164 if(LLVM_INCLUDE_TESTS)