File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ endif()
146146if (LLVM_RELEASE_ENABLE_LINK_LOCAL_RUNTIMES)
147147 set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL )
148148 set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL )
149+ set_instrument_and_final_stage_var(RUNTIMES_CMAKE_ARGS "-DLLVM_ENABLE_LIBCXX=ON" STRING )
149150 set (RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind" )
150151 if (NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin" )
151152 set (RELEASE_LINKER_FLAGS "${RELEASE_LINKER_FLAGS} -static-libgcc" )
Original file line number Diff line number Diff line change 1111project (libompd)
1212cmake_minimum_required (VERSION 3.20.0)
1313
14+ set (LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
15+ "Use -stdlibc++ instead of -libc++ library for C++ " )
16+
17+ set (LIBCXX_DEP)
18+ if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT ${LIBOMPD_LD_STD_FLAGS} )
19+ set (LIBCXX_DEP cxx)
20+ endif ()
21+
1422add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)
1523
1624# libompd must not link against libomp, there is no code dependency.
17- add_dependencies (ompd omp) # ensure generated import library is created first
25+ add_dependencies (ompd omp ${LIBCXX_DEP} ) # ensure generated import library is created first
1826
1927set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
2028
21- set (LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
22- "Use -stdlibc++ instead of -libc++ library for C++ " )
23-
2429if (${LIBOMPD_LD_STD_FLAGS} )
2530# Find and replace/add libstdc++ to compile flags
2631 STRING ( FIND "${CMAKE_CXX_FLAGS} " "-stdlib=libc++" OUT )
You can’t perform that action at this time.
0 commit comments