summaryrefslogtreecommitdiff
path: root/libcxxabi/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-11 03:03:21 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-01-11 18:24:50 +0000
commit0a8d15ad55e344419400f037393f2208214e33e0 (patch)
tree7a608f1b3d8fd77a69e985e6b6713ecb8deac081 /libcxxabi/CMakeLists.txt
parentbf52210e25e2c19203d9e2663d80befb405d385b (diff)
downloadllvm-0a8d15ad55e344419400f037393f2208214e33e0.tar.gz
[libc++][libc++abi][libunwind] Dedup install path var definitions
In D116873 I did this for libunwind prior to defining a new install path variable. But I think the change is good on its own, and libc++{,abi} could also use it. libc++ needed the base header var defined above the conditional part to use it for the prefi+ed headers in the non-target-specific case. For consistency, I therefore put the unconditional ones above for all 3 libs, which is why I touched the libunwind code (seeing that it had the core change already) Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D116988
Diffstat (limited to 'libcxxabi/CMakeLists.txt')
-rw-r--r--libcxxabi/CMakeLists.txt23
1 files changed, 10 insertions, 13 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 858f5d5cfd7f..89722df0bf46 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -210,31 +210,28 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
+set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH
+ "Path where built libc++abi runtime libraries should be installed.")
+
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
"Path where built libc++abi libraries should be installed.")
- set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH
- "Path where built libc++abi runtime libraries should be installed.")
if(LIBCXX_LIBDIR_SUBDIR)
string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR})
string(APPEND LIBCXXABI_INSTALL_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR})
endif()
-elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
- set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
- set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
- set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH
- "Path where built libc++abi libraries should be installed.")
- set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH
- "Path where built libc++abi runtime libraries should be installed.")
else()
- set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR})
- set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
+ if(LLVM_LIBRARY_OUTPUT_INTDIR)
+ set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR})
+ set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+ else()
+ set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR})
+ set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
+ endif()
set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH
"Path where built libc++abi libraries should be installed.")
- set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH
- "Path where built libc++abi runtime libraries should be installed.")
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})