[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
[llvm-project.git] / openmp / libompd / src / CMakeLists.txt
blobba228d5181048ee71efbdb99e2ac3a56c17c8115
2 #//===----------------------------------------------------------------------===//
3 #//
4 #// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 #// See https://llvm.org/LICENSE.txt for license information.
6 #// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 #//
8 #//===----------------------------------------------------------------------===//
11 project (libompd)
12 cmake_minimum_required(VERSION 3.20.0)
14 add_library (ompd SHARED TargetValue.cpp omp-debug.cpp omp-state.cpp omp-icv.cpp)
16 # libompd must not link against libomp, there is no code dependency.
17 add_dependencies(ompd omp) # ensure generated import library is created first
19 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
21 set(LIBOMPD_LD_STD_FLAGS FALSE CACHE BOOL
22   "Use -stdlibc++ instead of -libc++ library for C++ ")
24 if(${LIBOMPD_LD_STD_FLAGS})
25 #  Find and replace/add libstdc++ to compile flags     
26    STRING( FIND "${CMAKE_CXX_FLAGS}" "-stdlib=libc++" OUT )
27    if("${OUT}" STREQUAL "-1" )   
28       set (CMAKE_CXX_FLAGS "-stdlib=libstdc++ ${CMAKE_CXX_FLAGS}")
29    else()
30       STRING( REPLACE "-stdlib=libc++" "-stdlib=libstdc++" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
31    endif()         
33 #  Find and replace/add libstdc++ to loader flags
34    STRING( FIND "${CMAKE_SHARED_LINKER_FLAGS}" "-stdlib=libc++" OUT )
35    if("${OUT}" STREQUAL "-1" )   
36       set (CMAKE_SHARED_LINKER_FLAGS "-stdlib=libstdc++ ${CMAKE_SHARED_LINKER_FLAGS}")         
37    else()
38       STRING( REPLACE "-stdlib=libc++" "-stdlib=libstdc++" CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} )
39    endif()
40 endif()
42 include_directories (
43         ${CMAKE_CURRENT_SOURCE_DIR}
44         ${LIBOMP_INCLUDE_DIR}
45         ${LIBOMP_SRC_DIR}
48 INSTALL( TARGETS ompd
49         LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR}
50         ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}
51         RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" )