Skip to content

Commit

Permalink
clang build under linux with libc++ (OpenAtomFoundation#1789)
Browse files Browse the repository at this point in the history
Signed-off-by: lizhen6 <[email protected]>
  • Loading branch information
tedli authored Jul 22, 2023
1 parent dab8d1b commit e68c396
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_definitions(-DOS_MACOSX)
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -ldl -pthread")
set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ -fuse-ld=lld -lc++ -lc++abi ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -pthread ${CMAKE_CXX_FLAGS}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
set(CMAKE_CXX_FLAGS "-pthread -Wl,--no-as-needed -ldl")
Expand Down Expand Up @@ -223,7 +224,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
LOG_INSTALL
1
CONFIGURE_COMMAND
<SOURCE_DIR>/configure --prefix=${STAGED_INSTALL_PREFIX} --enable-minidebuginfo=no --enable-zlibdebuginfo=no
<SOURCE_DIR>/configure --prefix=${STAGED_INSTALL_PREFIX} --enable-minidebuginfo=no --enable-zlibdebuginfo=no --enable-shared=no
BUILD_IN_SOURCE
1
BUILD_COMMAND
Expand Down Expand Up @@ -487,6 +488,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
-DCMAKE_BUILD_TYPE=${LIB_BUILD_TYPE}
-DGPERFTOOLS_BUILD_STATIC=ON
-DEFAULT_BUILD_MINIMAL=ON
-Dgperftools_build_benchmark=OFF
BUILD_COMMAND
make -j${CPU_CORE}
)
Expand Down

0 comments on commit e68c396

Please sign in to comment.