Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/cmake/caches/Release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
list(APPEND DEFAULT_PROJECTS "bolt")
endif()

set (DEFAULT_RUNTIMES "compiler-rt;libcxx")
set (DEFAULT_RUNTIMES "compiler-rt;libcxx;openmp;flang-rt")
if (NOT WIN32)
list(APPEND DEFAULT_RUNTIMES "libcxxabi" "libunwind")
endif()
Expand Down Expand Up @@ -119,6 +119,7 @@ if (LLVM_RELEASE_ENABLE_LTO)
set_instrument_and_final_stage_var(LLVM_ENABLE_LLD "ON" BOOL)
endif()
set_instrument_and_final_stage_var(LLVM_ENABLE_LIBCXX "ON" BOOL)
set_instrument_and_final_stage_var(RUNTIMES_CMAKE_ARGS "-DLLVM_ENABLE_LIBCXX=ON" STRING)
set_instrument_and_final_stage_var(LLVM_STATIC_LINK_CXX_STDLIB "ON" BOOL)
set(RELEASE_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind")
if(NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Darwin")
Expand Down
13 changes: 9 additions & 4 deletions openmp/libompd/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@
project (libompd)
cmake_minimum_required(VERSION 3.20.0)

set(LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
"Use -stdlibc++ instead of -libc++ library for C++ ")

set(LIBCXX_DEP)
if("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT ${LIBOMPD_LD_STD_FLAGS})
set(LIBCXX_DEP cxx)
endif()

add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)

# libompd must not link against libomp, there is no code dependency.
add_dependencies(ompd omp) # ensure generated import library is created first
add_dependencies(ompd omp ${LIBCXX_DEP}) # ensure generated import library is created first

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
"Use -stdlibc++ instead of -libc++ library for C++ ")

if(${LIBOMPD_LD_STD_FLAGS})
# Find and replace/add libstdc++ to compile flags
STRING( FIND "${CMAKE_CXX_FLAGS}" "-stdlib=libc++" OUT )
Expand Down
Loading