39 lines · plain
1# //===----------------------------------------------------------------------===//2# //3# // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4# // See https://llvm.org/LICENSE.txt for details.5# // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6# //7# //===----------------------------------------------------------------------===//8 9set(LIBOMP_ARCHER_SUPPORT TRUE CACHE BOOL "Build libomp with archer support")10 11if(LIBOMP_OMPT_SUPPORT AND LIBOMP_ARCHER_SUPPORT)12 include_directories(${LIBOMP_INCLUDE_DIR})13 14 add_library(archer SHARED ompt-tsan.cpp)15 target_link_libraries(archer ${CMAKE_DL_LIBS})16 add_library(archer_static STATIC ompt-tsan.cpp)17 18 if(TARGET cxx-headers)19 add_dependencies(archer cxx-headers)20 add_dependencies(archer_static cxx-headers)21 endif()22 23 if(TARGET cxx_shared)24 add_dependencies(archer cxx_shared)25 add_dependencies(archer_static cxx_shared)26 endif()27 28 if(TARGET cxxabi_shared)29 add_dependencies(archer cxxabi_shared)30 add_dependencies(archer_static cxxabi_shared)31 endif()32 33 install(TARGETS archer archer_static34 LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR}35 ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR})36 37 add_subdirectory(tests)38endif()39