Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 071f23b

Browse files
committed
[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
1 parent f3303f0 commit 071f23b

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

runtimes/CMakeLists.txt

+4-19
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
120120
set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS})
121121
set(CMAKE_REQUIRED_LIBRARIES ${SAFE_CMAKE_REQUIRED_LIBRARIES})
122122

123-
if(NOT LLVM_RUNTIMES_PREFIX)
124-
set(LLVM_RUNTIMES_PREFIX "${LLVM_RUNTIMES_TARGET}/")
125-
endif()
126-
127-
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
128-
${PACKAGE_VERSION})
129-
130123
foreach(entry ${runtimes})
131124
get_filename_component(projName ${entry} NAME)
132125

@@ -136,15 +129,15 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
136129
# The subdirectories need to treat this as standalone builds
137130
set(${canon_name}_STANDALONE_BUILD On)
138131

132+
if(LLVM_RUNTIMES_LIBDIR_SUFFIX)
133+
set(${canon_name}_LIBDIR_SUFFIX "${LLVM_RUNTIMES_LIBDIR_SUFFIX}" CACHE STRING "" FORCE)
134+
endif()
135+
139136
# Setting a variable to let sub-projects detect which other projects
140137
# will be included under here.
141138
set(HAVE_${canon_name} On)
142139
endforeach()
143140

144-
set(SAFE_LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
145-
set(SAFE_LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
146-
set(SAFE_LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
147-
148141
# We do this in two loops so that HAVE_* is set for each runtime before the
149142
# other runtimes are added.
150143
foreach(entry ${runtimes})
@@ -167,14 +160,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
167160
list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS})
168161
list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS})
169162
list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS})
170-
171-
if(LLVM_RUNTIMES_TARGET)
172-
if(NOT "${projName}" MATCHES "compiler-rt")
173-
set(LLVM_BINARY_DIR "${SAFE_LLVM_BINARY_DIR}")
174-
set(LLVM_LIBRARY_OUTPUT_INTDIR "${SAFE_LLVM_LIBRARY_OUTPUT_INTDIR}")
175-
set(LLVM_RUNTIME_OUTPUT_INTDIR "${SAFE_LLVM_RUNTIME_OUTPUT_INTDIR}")
176-
endif()
177-
endif()
178163
endforeach()
179164

180165
if(LLVM_INCLUDE_TESTS)

0 commit comments

Comments
 (0)