[Openmp-commits] [openmp] bb099c8 - [openmp] Don't copy exports into the source folder by default.

David Truby via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 24 06:35:45 PDT 2020


Author: David Truby
Date: 2020-07-24T14:34:50+01:00
New Revision: bb099c87abbfb78b2bdda395ea3f04d2a77c3082

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

LOG: [openmp] Don't copy exports into the source folder by default.

Additionally fix the copy if enabled on multi-config targets.

Summary:
This changes the copy command for libomp.so to use the output of the target as
the source of the copy, rather than trying to find it based on
${LIBOMP_LIBRARY_DIR}, which appears to be incorrect in multi-config generator
builds.

Reviewers: jdoerfert

Subscribers: mgorny, yaxunl, guansong, sstefan1, openmp-commits

Tags: #openmp

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

Added: 
    

Modified: 
    openmp/runtime/CMakeLists.txt
    openmp/runtime/cmake/LibompExports.cmake

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/CMakeLists.txt b/openmp/runtime/CMakeLists.txt
index 40a0fb9afee1..e24528e9842f 100644
--- a/openmp/runtime/CMakeLists.txt
+++ b/openmp/runtime/CMakeLists.txt
@@ -114,7 +114,7 @@ set(LIBOMP_FFLAGS "" CACHE STRING
 # Turning this to FALSE aids parallel builds to not interfere with each other.
 # Currently, the testsuite module expects the just built OpenMP library to be located inside the exports/
 # directory.  TODO: have testsuite run under llvm-lit directly.  We can then get rid of copying to exports/
-set(LIBOMP_COPY_EXPORTS TRUE CACHE STRING
+set(LIBOMP_COPY_EXPORTS FALSE CACHE STRING
   "Should exports be copied into source exports/ directory?")
 
 # HWLOC-support

diff  --git a/openmp/runtime/cmake/LibompExports.cmake b/openmp/runtime/cmake/LibompExports.cmake
index f98de2631b83..96dab9f4a465 100644
--- a/openmp/runtime/cmake/LibompExports.cmake
+++ b/openmp/runtime/cmake/LibompExports.cmake
@@ -78,7 +78,7 @@ if(NOT LIBOMP_OUTPUT_DIRECTORY)
 endif()
 add_custom_command(TARGET omp POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_LIB_DIR}
-  COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR}
+  COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:omp> ${LIBOMP_EXPORTS_LIB_DIR}
 )
 
 # Copy Windows import library into exports/ directory post build


        


More information about the Openmp-commits mailing list