[compiler-rt][cmake] Use HandleOutOfTreeLLVM like libcxx and friends

This gives us the option of using CMake modules from LLVM, and other
things. We will use that to deduplicate code later.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D117815
This commit is contained in:
John Ericson 2022-01-20 19:04:15 +00:00
parent 1f3f90ab88
commit 8c9f62ea90
1 changed files with 10 additions and 7 deletions

View File

@ -5,13 +5,6 @@
cmake_minimum_required(VERSION 3.13.4)
# Check if compiler-rt is built as a standalone project.
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
project(CompilerRT C CXX ASM)
set(COMPILER_RT_STANDALONE_BUILD TRUE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
# Add path for custom compiler-rt modules.
@ -22,6 +15,16 @@ list(INSERT CMAKE_MODULE_PATH 0
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
)
# Check if compiler-rt is built as a standalone project.
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
project(CompilerRT C CXX ASM)
set(COMPILER_RT_STANDALONE_BUILD TRUE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Find the LLVM sources and simulate LLVM CMake options.
include(HandleOutOfTreeLLVM)
endif()
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CFG_RESOLVED_INTDIR "${CMAKE_CFG_INTDIR}/")
else()