Skip to content

Commit 36081b7

Browse files
authored
Merge pull request #90 from isuruf/ninja-deps
CMake: revert changes to iso_c_binding
2 parents f7ca018 + 281cc42 commit 36081b7

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

runtime/flang/CMakeLists.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,9 @@ SET(FTN_SUPPORT
335335
descIntrins.c
336336
descFioUtil.c
337337
descRW.c
338-
ieee_arithmetic.F95
339-
ieee_exceptions.F95
340338
ieee_features.F95
341339
initpar.c
342340
inquire.c
343-
iso_c_bind.F95
344341
iso_fortran_env.f90
345342
ldread.c
346343
ldwrite.c
@@ -477,16 +474,25 @@ SET(FTN_SUPPORT
477474
xfer_rpm1.c
478475
)
479476

477+
add_library(iso_c_bind
478+
iso_c_bind.F95
479+
)
480+
481+
add_library(ieee_arithmetic
482+
ieee_arithmetic.F95
483+
ieee_exceptions.F95
484+
)
485+
480486
add_flang_library(flang_static
481487
${FTN_INTRINSICS}
482488
${FTN_SUPPORT}
483489
${SHARED_SOURCES}
484490
)
485491

486492
if (MSVC)
487-
set_property(TARGET flang_static PROPERTY OUTPUT_NAME libflang)
493+
set_property(TARGET flang_static PROPERTY OUTPUT_NAME libflang)
488494
else()
489-
set_property(TARGET flang_static PROPERTY OUTPUT_NAME flang)
495+
set_property(TARGET flang_static PROPERTY OUTPUT_NAME flang)
490496
endif()
491497

492498
set(SHARED_LIBRARY TRUE)
@@ -545,20 +551,6 @@ set_property(
545551
## CMake does not handle module dependencies between Fortran files,
546552
## we need to help it
547553

548-
# State the module that the source is producing
549-
set_source_files_properties(
550-
iso_c_bind.F95
551-
PROPERTIES
552-
OBJECT_OUTPUTS ${CMAKE_Fortran_MODULE_DIRECTORY}/iso_c_binding.mod
553-
)
554-
555-
# State a dependency on the module
556-
set_source_files_properties(
557-
ieee_arithmetic.F95
558-
ieee_exceptions.F95
559-
PROPERTIES
560-
OBJECT_DEPENDS ${CMAKE_Fortran_MODULE_DIRECTORY}/iso_c_binding.mod
561-
)
562554

563555
set_target_properties(flang_static flang_shared
564556
PROPERTIES
@@ -589,6 +581,18 @@ add_dependencies(flang_shared
589581
flang2
590582
)
591583

584+
add_dependencies(iso_c_bind
585+
flang1
586+
flang2
587+
)
588+
589+
add_dependencies(ieee_arithmetic
590+
iso_c_bind
591+
)
592+
593+
target_link_libraries(flang_static iso_c_bind ieee_arithmetic)
594+
target_link_libraries(flang_shared iso_c_bind ieee_arithmetic)
595+
592596
if (NOT MSVC)
593597
target_compile_options(flang_static PRIVATE -fPIC)
594598
target_compile_options(flang_shared PRIVATE -fPIC)

0 commit comments

Comments
 (0)