Skip to content

Commit 9af1f59

Browse files
authored
Merge pull request #1148 from ndingle-arm/cmake-parallel-patch
Capture module file dependencies in CMake
2 parents 98f34fd + 146da1d commit 9af1f59

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

SRC/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
#
3737
#######################################################################
3838

39-
set(ALLMOD la_xisnan.F90 la_constants.f90)
39+
set(CONSTMOD la_constants.f90)
40+
41+
set(NANMOD la_xisnan.F90)
4042

4143
set(ALLAUX ilaenv.f ilaenv2stage.f ieeeck.f lsamen.f iparmq.f iparam2stage.F
4244
ilaprec.f ilatrans.f ilauplo.f iladiag.f chla_transtype.f
@@ -519,7 +521,14 @@ list(REMOVE_DUPLICATES SOURCES)
519521

520522
# Use special target for MOD files to guarantee they are built before
521523
# any other files that depend on them
522-
add_library(mod_files OBJECT ${ALLMOD})
524+
add_library(const_mod_file OBJECT ${CONSTMOD})
525+
set_target_properties(
526+
const_mod_file PROPERTIES
527+
POSITION_INDEPENDENT_CODE ON
528+
Fortran_PREPROCESS ON
529+
)
530+
531+
add_library(mod_files OBJECT ${NANMOD} $<TARGET_OBJECTS:const_mod_file>)
523532
set_target_properties(
524533
mod_files PROPERTIES
525534
POSITION_INDEPENDENT_CODE ON

0 commit comments

Comments
 (0)