Skip to content

Commit bfb371a

Browse files
committedNov 11, 2016
[CMake] Check runtimes subdir when looking for libcxx and libuwind
The runtimes subdir is the new location for runtimes, we should include it when looking for libcxx and libunwind headers. Differential Revision: https://reviews.llvm.org/D26362 llvm-svn: 286614
1 parent da2028b commit bfb371a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
 

‎libcxxabi/CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,26 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
138138
endif()
139139

140140
if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR)
141-
set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
141+
set(LIBCXXABI_LIBCXX_SRC_DIRS ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
142142
else()
143-
set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_MAIN_SRC_DIR}/projects/libcxx)
143+
set(LIBCXXABI_LIBCXX_SRC_DIRS
144+
"${LLVM_MAIN_SRC_DIR}/projects/libcxx"
145+
"${LLVM_MAIN_SRC_DIR}/runtimes/libcxx"
146+
)
144147
endif()
145148

149+
set(LIBCXXABI_LIBCXX_INCLUDE_DIRS "")
150+
foreach(dir ${LIBCXXABI_LIBCXX_SRC_DIRS})
151+
list(APPEND LIBCXXABI_LIBCXX_INCLUDE_DIRS "${dir}/include")
152+
endforeach()
153+
146154
find_path(
147155
LIBCXXABI_LIBCXX_INCLUDES
148156
vector
149157
PATHS ${LIBCXXABI_LIBCXX_INCLUDES}
150158
${LIBCXXABI_LIBCXX_PATH}/include
151159
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
152-
${LIBCXXABI_LIBCXX_SRC_DIR}/include
160+
${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
153161
${LLVM_INCLUDE_DIR}/c++/v1
154162
)
155163

@@ -161,7 +169,7 @@ find_path(
161169
test/libcxx/__init__.py
162170
PATHS ${LIBCXXABI_LIBCXX_PATH}
163171
${LIBCXXABI_LIBCXX_INCLUDES}/../
164-
${LIBCXXABI_LIBCXX_SRC_DIR}
172+
${LIBCXXABI_LIBCXX_SRC_DIRS}
165173
NO_DEFAULT_PATH
166174
)
167175

@@ -380,6 +388,7 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
380388
${LIBCXXABI_LIBUNWIND_PATH}/include
381389
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
382390
${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
391+
${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
383392
NO_DEFAULT_PATH
384393
)
385394

@@ -389,6 +398,7 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
389398
PATHS ${LIBCXXABI_LIBUNWIND_PATH}/src/
390399
${LIBCXXABI_LIBUNWIND_INCLUDES}/../src/
391400
${LLVM_MAIN_SRC_DIR}/projects/libunwind/src/
401+
${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/src/
392402
NO_DEFAULT_PATH
393403
)
394404

0 commit comments

Comments
 (0)
Please sign in to comment.