[Openmp-commits] [openmp] 2ec8571 - [OpenMP] Add back in	`ENABLE_LIBOMPTARGET' definition
    Joseph Huber via Openmp-commits 
    openmp-commits at lists.llvm.org
       
    Wed May 15 09:58:21 PDT 2024
    
    
  
Author: Joseph Huber
Date: 2024-05-15T11:58:16-05:00
New Revision: 2ec85713bd910c5b22ce090798ca00f742d5eb14
URL: https://github.com/llvm/llvm-project/commit/2ec85713bd910c5b22ce090798ca00f742d5eb14
DIFF: https://github.com/llvm/llvm-project/commit/2ec85713bd910c5b22ce090798ca00f742d5eb14.diff
LOG: [OpenMP] Add back in `ENABLE_LIBOMPTARGET' definition
Summary:
Even though we moved `libomptarget` this is still present in `omp.h` and
can't be removed.
Added: 
    
Modified: 
    openmp/CMakeLists.txt
Removed: 
    
################################################################################
diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 33bfdc8630eff..9097ca5623000 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -97,6 +97,18 @@ set(OPENMP_TEST_FLAGS "" CACHE STRING
 set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING
   "OpenMP compiler flag to use for testing OpenMP runtime libraries.")
 
+set(ENABLE_LIBOMPTARGET ON)
+# 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.
+# 32-bit systems are not supported either.
+if (APPLE OR WIN32 OR WASM OR NOT "cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES
+    OR NOT CMAKE_SIZEOF_VOID_P EQUAL 8 OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+  set(ENABLE_LIBOMPTARGET OFF)
+endif()
+
+option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
+       ${ENABLE_LIBOMPTARGET})
 option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
 
 # Header install location
        
    
    
More information about the Openmp-commits
mailing list