Add support for libc++ and compiler-rt

This commit is contained in:
Sameer Rahmani 2022-06-13 21:07:51 +01:00
parent 8553b5f43f
commit f98eaabbc4
2 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,7 @@ option(SERENE_SHOW_MLIR_TRANSFORMERS "Print out a list of MLIR dialect transform
option(SERENE_SHOW_LLVM_LIBS "Print all the llvm libs available" OFF)
option(SERENE_WITH_MLIR_CL_OPTION "Add support for controlling MLIR via command line options" OFF)
option(SERENE_USE_COMPILER_RT "Use LLVM's compiler-rt" OFF)
# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
@ -119,6 +119,10 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
#--static
)
if (SERENE_USE_COMPILER_RT)
add_link_options(-rtlib=compiler-rt -stdlib=libc++ )
endif()
# Do we need to build serene as a shared lib? default is "yes"
if(SERENE_SHARED_LIB)
set(BUILD_SHARED_LIBS "${SERENE_SHARED_LIB}")

View File

@ -46,7 +46,7 @@ Setup the githook and install dependencies using the following commands:
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_CCACHE_BUILD=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;compiler-rt' \
-DLLVM_ENABLE_PROJECTS='clang;lldb;lld;mlir;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind' \
-DCMAKE_C_COMPILER=clang \ # If you have clang installed already
-DCMAKE_CXX_COMPILER=clang++ \ # If you have clang installed already
-DLLVM_ENABLE_LLD=ON