mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
24a6fb0a17
libc++. This lets me almost self-host on Linux with libc++ and libc++abi very simply. Currently, MCJIT and OrcJIT are failing due to uncaught exceptions, and the Go binding tests are failing to build due to not linking in the correct C++ standard library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231560 91177308-0d34-0410-b5e6-96231b3b80d8
42 lines
1.3 KiB
CMake
42 lines
1.3 KiB
CMake
# This CMake module is responsible for setting the standard library to libc++
|
|
# if the user has requested it.
|
|
|
|
if(NOT DEFINED LLVM_STDLIB_HANDLED)
|
|
set(LLVM_STDLIB_HANDLED ON)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
|
|
elseif( MSVC )
|
|
set(LLVM_COMPILER_IS_GCC_COMPATIBLE OFF)
|
|
elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
|
|
set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
|
|
endif()
|
|
|
|
function(append value)
|
|
foreach(variable ${ARGN})
|
|
set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
|
|
endforeach(variable)
|
|
endfunction()
|
|
|
|
include(CheckCXXCompilerFlag)
|
|
if(LLVM_ENABLE_LIBCXX)
|
|
if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
|
|
check_cxx_compiler_flag("-stdlib=libc++" CXX_SUPPORTS_STDLIB)
|
|
if(CXX_SUPPORTS_STDLIB)
|
|
append("-stdlib=libc++"
|
|
CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
|
|
CMAKE_MODULE_LINKER_FLAGS)
|
|
if(LLVM_ENABLE_LIBCXXABI)
|
|
append("-lc++abi"
|
|
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS
|
|
CMAKE_MODULE_LINKER_FLAGS)
|
|
endif()
|
|
else()
|
|
message(WARNING "Can't specify libc++ with '-stdlib='")
|
|
endif()
|
|
else()
|
|
message(WARNING "Not sure how to specify libc++ for this compiler")
|
|
endif()
|
|
endif()
|
|
endif()
|