Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/tools/llvm-libgcc/CMakeLists.txt
- This file was added.
cmake_minimum_required(VERSION 3.13.4) | |||||
# If we are not building as a part of LLVM, build llvm-libgcc as a standalone | |||||
# project, using compiler-rt and libunwind external libraries. | |||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | |||||
project(LLVM_LIBGCC) | |||||
if(NOT LLVM_LIBGCC_LIBUNWIND_DIR) | |||||
message(FATAL_ERROR | |||||
compnerd: Perhaps we can default the path since the layout is now fairly uniform due to the merged… | |||||
"We're building llvm-libgcc as a standalone project, but we didn't " | |||||
" supply a path to LLVM_LIBGCC_LIBUNWIND_DIR. It's not possible to build " | |||||
"llvm-libgcc without this path!") | |||||
endif() | |||||
elseif(NOT LLVM_ENABLE_LIBGCC) | |||||
return() | |||||
endif() | |||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") | |||||
set(LLVM_LIBGCC_SYSROOT "${CMAKE_INSTALL_PREFIX}" CACHE PATH | |||||
"Assumes this path as the root directory when setting symlinks.") | |||||
set(LLVM_LIBGCC_COMPILER_RT_DIR "" CACHE PATH | |||||
"Absolute path to a pre-existing compiler-rt builtins.") | |||||
find_package(CompilerRT REQUIRED) | |||||
string(REGEX REPLACE "^${LLVM_LIBGCC_SYSROOT}/lib${LLVMLIB_DIR_SUFFIX}/*" "" | |||||
LLVM_LIBGCC_COMPILER_RT "${LLVM_LIBGCC_COMPILER_RT}") | |||||
set(LLVM_LIBGCC_LIBUNWIND_DIR "" CACHE PATH | |||||
"Absolute path to a pre-existing libunwind.a.") | |||||
find_package(LLVMLibunwind REQUIRED) | |||||
string(REGEX REPLACE "^${LLVM_LIBGCC_SYSROOT}/lib${LLVMLIB_DIR_SUFFIX}/*" "" | |||||
LLVM_LIBGCC_UNWIND_STATIC "${LLVM_LIBGCC_UNWIND_STATIC}") | |||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib${LLVMLIB_DIR_SUFFIX}") | |||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib${LLVMLIB_DIR_SUFFIX}") | |||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib${LLVMLIB_DIR_SUFFIX}") | |||||
Not Done ReplyInline ActionsI think that bin rather than lib is appropriate. The CMAKE_RUNTIME_OUTPUT_DIRECTORY is used for the executables and dlls on Windows. compnerd: I think that `bin` rather than `lib` is appropriate. The `CMAKE_RUNTIME_OUTPUT_DIRECTORY` is… | |||||
add_subdirectory(lib) |
Perhaps we can default the path since the layout is now fairly uniform due to the merged repository layout.