================
@@ -232,6 +232,22 @@ if(LIBC_GPU_BUILD)
   list(APPEND RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES "libc")
 endif()
 
+# Set up Arm64X build of the OpenMP runtime
+option(LIBOMP_ENABLE_ARM64X "Build the OpenMP library as Arm64X for 
compatibility with both Arm64 and Arm64EC" OFF)
+if(LIBOMP_ENABLE_ARM64X)
+  if(NOT LLVM_HOST_TRIPLE STREQUAL "aarch64-pc-windows-msvc")
+    messsage(FATAL_ERROR "Arm64X builds are only supported on Windows on Arm 
hosts.")
+  endif()
+  if(NOT LLVM_RUNTIME_TARGETS)
+    set(LLVM_RUNTIME_TARGETS "default")
+  endif()
+
+  if(NOT "arm64ec-pc-windows-msvc" IN_LIST LLVM_RUNTIME_TARGETS)
+    list(APPEND LLVM_RUNTIME_TARGETS "arm64ec-pc-windows-msvc")
+  endif()
+  set(RUNTIMES_arm64ec-pc-windows-msvc_LIBOMP_ENABLE_ARM64X ON)
+endif()
----------------
DavidTruby wrote:

It'll only error out when cross compiling if you also request the ARM64X build 
there, and that won't work anyway atm so we _should_ error out in that case I 
think?

I suppose it could be done with a cache file but we still need to establish the 
`LIBOMP_ENABLE_ARM64X` variable somehow, and check that it's not being used in 
a way that won't work, so I'd still have to just change these `set(...` 
commands to `if(NOT ...) message(FATAL_ERROR ...)` or there will just be 
confusing failures way later in the build

https://github.com/llvm/llvm-project/pull/176157
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to