1
0
mirror of https://github.com/exaloop/codon.git synced 2025-06-03 15:03:52 +08:00

Remove -static-libstdc++ compilation flag

This commit is contained in:
A. R. Shajii 2025-02-18 14:49:45 -05:00
parent d035f1dc97
commit b17d21513d

View File

@ -48,10 +48,8 @@ include(${CMAKE_SOURCE_DIR}/cmake/deps.cmake)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if(APPLE) if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/../lib/codon") set(CMAKE_INSTALL_RPATH "@loader_path;@loader_path/../lib/codon")
set(STATIC_LIBCPP "")
else() else()
set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib/codon") set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib/codon")
set(STATIC_LIBCPP "-static-libstdc++")
endif() endif()
add_executable(peg2cpp codon/util/peg2cpp.cpp) add_executable(peg2cpp codon/util/peg2cpp.cpp)
@ -138,7 +136,7 @@ target_include_directories(codonrt PRIVATE ${backtrace_SOURCE_DIR}
${highway_SOURCE_DIR} ${highway_SOURCE_DIR}
"${gc_SOURCE_DIR}/include" "${gc_SOURCE_DIR}/include"
"${fast_float_SOURCE_DIR}/include" runtime) "${fast_float_SOURCE_DIR}/include" runtime)
target_link_libraries(codonrt PRIVATE fmt omp backtrace ${STATIC_LIBCPP} LLVMSupport) target_link_libraries(codonrt PRIVATE fmt omp backtrace LLVMSupport)
if(APPLE) if(APPLE)
target_link_libraries( target_link_libraries(
codonrt codonrt
@ -434,11 +432,7 @@ llvm_map_components_to_libnames(
TransformUtils TransformUtils
Vectorize Vectorize
Passes) Passes)
if(APPLE) target_link_libraries(codonc PRIVATE ${LLVM_LIBS} fmt dl codonrt)
target_link_libraries(codonc PRIVATE ${LLVM_LIBS} fmt dl codonrt)
else()
target_link_libraries(codonc PRIVATE ${STATIC_LIBCPP} ${LLVM_LIBS} fmt dl codonrt)
endif()
# Gather headers # Gather headers
add_custom_target( add_custom_target(
@ -482,7 +476,7 @@ add_dependencies(libs codonrt codonc)
# Codon command-line tool # Codon command-line tool
add_executable(codon codon/app/main.cpp) add_executable(codon codon/app/main.cpp)
target_link_libraries(codon PUBLIC ${STATIC_LIBCPP} fmt codonc codon_jupyter Threads::Threads) target_link_libraries(codon PUBLIC fmt codonc codon_jupyter Threads::Threads)
# Codon test Download and unpack googletest at configure time # Codon test Download and unpack googletest at configure time
include(FetchContent) include(FetchContent)