Mercurial > hg > CbC > CbC_llvm
comparison openmp/CMakeLists.txt @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
1 cmake_minimum_required(VERSION 2.8 FATAL_ERROR) | 1 cmake_minimum_required(VERSION 3.13.4) |
2 | 2 |
3 # Add cmake directory to search for custom cmake functions. | 3 # Add cmake directory to search for custom cmake functions. |
4 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) | 4 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) |
5 | 5 |
6 # llvm/runtimes/ will set OPENMP_STANDALONE_BUILD. | 6 # llvm/runtimes/ will set OPENMP_STANDALONE_BUILD. |
51 set(OPENMP_TEST_FLAGS "" CACHE STRING | 51 set(OPENMP_TEST_FLAGS "" CACHE STRING |
52 "Extra compiler flags to send to the test compiler.") | 52 "Extra compiler flags to send to the test compiler.") |
53 set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING | 53 set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING |
54 "OpenMP compiler flag to use for testing OpenMP runtime libraries.") | 54 "OpenMP compiler flag to use for testing OpenMP runtime libraries.") |
55 | 55 |
56 | |
57 # Build host runtime library. | |
58 add_subdirectory(runtime) | |
59 | |
60 | |
61 set(ENABLE_LIBOMPTARGET ON) | 56 set(ENABLE_LIBOMPTARGET ON) |
62 # Currently libomptarget cannot be compiled on Windows or MacOS X. | 57 # Currently libomptarget cannot be compiled on Windows or MacOS X. |
63 # Since the device plugins are only supported on Linux anyway, | 58 # Since the device plugins are only supported on Linux anyway, |
64 # there is no point in trying to compile libomptarget on other OSes. | 59 # there is no point in trying to compile libomptarget on other OSes. |
65 if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG) | 60 if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG) |
66 set(ENABLE_LIBOMPTARGET OFF) | 61 set(ENABLE_LIBOMPTARGET OFF) |
67 endif() | 62 endif() |
68 | 63 |
69 option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading." | 64 option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading." |
70 ${ENABLE_LIBOMPTARGET}) | 65 ${ENABLE_LIBOMPTARGET}) |
66 option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for libomptarget." | |
67 ${ENABLE_LIBOMPTARGET}) | |
68 option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF) | |
69 | |
70 # Build host runtime library, after LIBOMPTARGET variables are set since they are needed | |
71 # to enable time profiling support in the OpenMP runtime. | |
72 add_subdirectory(runtime) | |
73 | |
71 if (OPENMP_ENABLE_LIBOMPTARGET) | 74 if (OPENMP_ENABLE_LIBOMPTARGET) |
72 # Check that the library can actually be built. | 75 # Check that the library can actually be built. |
73 if (APPLE OR WIN32) | 76 if (APPLE OR WIN32) |
74 message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!") | 77 message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!") |
75 elseif (NOT OPENMP_HAVE_STD_CPP14_FLAG) | 78 elseif (NOT OPENMP_HAVE_STD_CPP14_FLAG) |
89 ${ENABLE_OMPT_TOOLS}) | 92 ${ENABLE_OMPT_TOOLS}) |
90 if (OPENMP_ENABLE_OMPT_TOOLS) | 93 if (OPENMP_ENABLE_OMPT_TOOLS) |
91 add_subdirectory(tools) | 94 add_subdirectory(tools) |
92 endif() | 95 endif() |
93 | 96 |
97 | |
98 # Build documentation | |
99 add_subdirectory(docs) | |
100 | |
94 # Now that we have seen all testsuites, create the check-openmp target. | 101 # Now that we have seen all testsuites, create the check-openmp target. |
95 construct_check_openmp_target() | 102 construct_check_openmp_target() |