[Openmp-commits] [PATCH] D146894: [OpenMP] Fix an OpenMP Windows build problem

Vadim Paretsky via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Mar 25 18:45:50 PDT 2023


vadikp-intel created this revision.
vadikp-intel added reviewers: mstorsjo, hans.
vadikp-intel added a project: OpenMP.
Herald added subscribers: sunshaoce, guansong, yaxunl.
Herald added a project: All.
vadikp-intel requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, jplehr, sstefan1.

When built as part of LLVM, CMAKE generates incorrect locations references for the first build step's artifacts being used in regenerating the Windows import library in the second step. The fix is not to reuse first step's artifacts and build the regenerated import library from scratch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146894

Files:
  openmp/runtime/src/CMakeLists.txt


Index: openmp/runtime/src/CMakeLists.txt
===================================================================
--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -297,10 +297,9 @@
     )
     # while this is merely generating an import library off the one generated with the runtime dll,
     # kmp_global.cpp will satisfy the librarian's apparent ask to see the actual exported DATA items
-    set_source_files_properties(${LIBOMP_GENERATED_IMP_LIB_FILENAME} PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
-    add_library(${LIBOMP_IMP_LIB_TARGET} STATIC ${LIBOMP_GENERATED_IMP_LIB_FILENAME} kmp_global.cpp)
+    add_library(${LIBOMP_IMP_LIB_TARGET} STATIC ${LIBOMP_SOURCE_FILES})
     set_target_properties(${LIBOMP_IMP_LIB_TARGET} PROPERTIES
-        PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" LINKER_LANGUAGE C
+        PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
         STATIC_LIBRARY_OPTIONS "${CMAKE_LINK_DEF_FILE_FLAG}${CMAKE_CURRENT_BINARY_DIR}/${LIBOMPIMP_GENERATED_DEF_FILE}")
     add_dependencies(${LIBOMP_IMP_LIB_TARGET} omp libompimp-needed-def-file)
   endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146894.508362.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230326/7837713c/attachment.bin>


More information about the Openmp-commits mailing list