File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,15 @@ if(${LIBOMP_OMPT_SUPPORT})
6565 )
6666endif ()
6767if (${LIBOMP_FORTRAN_MODULES} )
68- add_custom_command (TARGET libomp-mod POST_BUILD
68+ # libomp-mod is an OBJECT library which does not have a POST_BUILD command.
69+ # attach it to omp instead an ensure libomp-mod is built before.
70+ add_custom_command (TARGET omp POST_BUILD
6971 COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_MOD_DIR}
7072 COMMAND ${CMAKE_COMMAND} -E copy omp_lib.mod ${LIBOMP_EXPORTS_MOD_DIR}
7173 COMMAND ${CMAKE_COMMAND} -E copy omp_lib_kinds.mod ${LIBOMP_EXPORTS_MOD_DIR}
7274 )
75+ add_dependencies (omp libomp-mod)
76+
7377 add_custom_command (TARGET omp POST_BUILD
7478 COMMAND ${CMAKE_COMMAND} -E copy omp_lib.h ${LIBOMP_EXPORTS_CMN_DIR}
7579 )
Original file line number Diff line number Diff line change @@ -388,11 +388,6 @@ endif()
388388configure_file (${LIBOMP_INC_DIR} /omp_lib.h.var omp_lib.h @ONLY)
389389configure_file (${LIBOMP_INC_DIR} /omp_lib.F90.var omp_lib.F90 @ONLY)
390390
391- # Move files to exports/ directory if requested
392- if (${LIBOMP_COPY_EXPORTS} )
393- include (LibompExports)
394- endif ()
395-
396391# Micro test rules for after library has been built (cmake/LibompMicroTests.cmake)
397392include (LibompMicroTests)
398393add_custom_target (libomp-micro-tests)
@@ -516,3 +511,8 @@ if(LIBOMP_FORTRAN_MODULES)
516511 DESTINATION ${DEVEL_PACKAGE}${destination}
517512 )
518513endif ()
514+
515+ # Move files to exports/ directory if requested
516+ if (${LIBOMP_COPY_EXPORTS} )
517+ include (LibompExports)
518+ endif ()
You can’t perform that action at this time.
0 commit comments