[llvm-branch-commits] [llvm] 36b0dd8 - [OpenMP] Fixed the issue that CMake variables for OpenMP were not passed through when building OpenMP with LLVM_ENABLE_RUNTIMES

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Dec 20 15:44:28 PST 2020


Author: Shilei Tian
Date: 2020-12-20T18:40:12-05:00
New Revision: 36b0dd8f678fc446f8088963a70d701507ced8fc

URL: https://github.com/llvm/llvm-project/commit/36b0dd8f678fc446f8088963a70d701507ced8fc
DIFF: https://github.com/llvm/llvm-project/commit/36b0dd8f678fc446f8088963a70d701507ced8fc.diff

LOG: [OpenMP] Fixed the issue that CMake variables for OpenMP were not passed through when building OpenMP with LLVM_ENABLE_RUNTIMES

Currently when building OpenMP along with LLVM, CMake variables for OpenMP (prefix with `LIBOMP` and `LIBOMPTARGET`) will not be passed through because by default it uses the prefix of the runtime name, aka `OPENMP` in this case. This patch fixed this issue.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D93603

Added: 
    

Modified: 
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 598daa4502e1..57db5c37847d 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -355,6 +355,9 @@ ${error} Set RUNTIMES_BUILD_ALLOW_DARWIN to allow a single darwin triple.")
     string(REPLACE "-" "_" canon_name ${projName})
     string(TOUPPER ${canon_name} canon_name)
     list(APPEND prefixes ${canon_name})
+    if (${canon_name} STREQUAL "OPENMP")
+      list(APPEND prefixes "LIBOMP" "LIBOMPTARGET")
+    endif()
     # Many compiler-rt options start with SANITIZER_ rather than COMPILER_RT_,
     # so when compiler-rt is enabled, consider both.
     if(canon_name STREQUAL "COMPILER_RT")


        


More information about the llvm-branch-commits mailing list