2015-05-06 04:02:52 +08:00
|
|
|
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
2016-02-05 15:00:13 +08:00
|
|
|
|
2017-11-30 03:31:43 +08:00
|
|
|
# llvm/runtimes/ will set OPENMP_STANDALONE_BUILD.
|
|
|
|
if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
set(OPENMP_STANDALONE_BUILD TRUE)
|
|
|
|
project(openmp C CXX)
|
|
|
|
|
|
|
|
# CMAKE_BUILD_TYPE was not set, default to Release.
|
|
|
|
if (NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.")
|
|
|
|
endif()
|
2016-02-05 15:00:13 +08:00
|
|
|
|
2016-12-21 17:04:08 +08:00
|
|
|
add_subdirectory(runtime)
|
2017-02-11 01:13:28 +08:00
|
|
|
|
2017-07-26 21:55:00 +08:00
|
|
|
|
2017-11-23 01:15:18 +08:00
|
|
|
set(ENABLE_LIBOMPTARGET ON)
|
2017-03-22 02:19:09 +08:00
|
|
|
# Currently libomptarget cannot be compiled on Windows or MacOS X.
|
|
|
|
# Since the device plugins are only supported on Linux anyway,
|
|
|
|
# there is no point in trying to compile libomptarget on other OSes.
|
2017-07-26 21:55:00 +08:00
|
|
|
if (WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
set(ENABLE_LIBOMPTARGET OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
|
|
|
|
${ENABLE_LIBOMPTARGET})
|
|
|
|
if (OPENMP_ENABLE_LIBOMPTARGET)
|
2017-02-11 01:13:28 +08:00
|
|
|
add_subdirectory(libomptarget)
|
|
|
|
endif()
|