File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,6 @@ set(OPENMP_TEST_FLAGS "" CACHE STRING
5555set (OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING
5656 "OpenMP compiler flag to use for testing OpenMP runtime libraries." )
5757
58-
59- # Build host runtime library.
60- add_subdirectory (runtime)
61-
62-
6358set (ENABLE_LIBOMPTARGET ON )
6459# Currently libomptarget cannot be compiled on Windows or MacOS X.
6560# Since the device plugins are only supported on Linux anyway,
@@ -86,6 +81,11 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
8681 ${ENABLE_LIBOMPTARGET} )
8782option (OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for libomptarget."
8883 ${ENABLE_LIBOMPTARGET} )
84+
85+ # Build host runtime library, after LIBOMPTARGET variables are set since they are needed
86+ # to enable time profiling support in the OpenMP runtime.
87+ add_subdirectory (runtime)
88+
8989if (OPENMP_ENABLE_LIBOMPTARGET)
9090 # Check that the library can actually be built.
9191 if (APPLE OR WIN32 )
Original file line number Diff line number Diff line change @@ -50,6 +50,15 @@ if(${LIBOMP_USE_HWLOC})
5050 include_directories (${LIBOMP_HWLOC_INSTALL_DIR} /include )
5151endif ()
5252
53+ # Building with time profiling support for libomptarget requires
54+ # LLVM directory includes.
55+ if (LIBOMPTARGET_PROFILING_SUPPORT)
56+ include_directories (
57+ ${LLVM_MAIN_INCLUDE_DIR}
58+ ${LLVM_INCLUDE_DIR}
59+ )
60+ endif ()
61+
5362# Getting correct source files to build library
5463set (LIBOMP_CXXFILES)
5564set (LIBOMP_ASMFILES)
You can’t perform that action at this time.
0 commit comments