Skip to content

Commit 4877135

Browse files
authored
Merge pull request #112 from isuruf/fix-race
CMake: fix build race condition
2 parents 47ef32e + 407e07e commit 4877135

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

runtime/flang/CMakeLists.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,23 @@ SET(FTN_SUPPORT
475475
xfer.c
476476
init.c
477477
xfer_rpm1.c
478+
)
479+
480+
add_library(iso_c_bind OBJECT
481+
iso_c_bind.F95
482+
)
483+
484+
add_library(ieee_arithmetic OBJECT
478485
ieee_arithmetic.F95
479486
ieee_exceptions.F95
480-
iso_c_bind.F95
481-
)
487+
)
482488

483489
add_flang_library(flang_static
484490
${FTN_INTRINSICS}
485491
${FTN_SUPPORT}
486492
${SHARED_SOURCES}
493+
$<TARGET_OBJECTS:iso_c_bind>
494+
$<TARGET_OBJECTS:ieee_arithmetic>
487495
)
488496

489497
set_target_properties(flang_static
@@ -497,21 +505,14 @@ else()
497505
set_property(TARGET flang_static PROPERTY OUTPUT_NAME flang)
498506
endif()
499507

500-
add_library(iso_c_bind OBJECT
501-
iso_c_bind.F95
502-
)
503-
504-
add_library(ieee_arithmetic OBJECT
505-
ieee_arithmetic.F95
506-
ieee_exceptions.F95
507-
)
508-
509508
set(SHARED_LIBRARY TRUE)
510509

511510
add_flang_library(flang_shared
512511
${FTN_INTRINSICS}
513512
${FTN_SUPPORT}
514513
${SHARED_SOURCES}
514+
$<TARGET_OBJECTS:iso_c_bind>
515+
$<TARGET_OBJECTS:ieee_arithmetic>
515516
)
516517

517518
set_property(TARGET flang_shared PROPERTY OUTPUT_NAME flang)
@@ -587,14 +588,12 @@ target_include_directories(flang_shared
587588
add_dependencies(flang_static
588589
flang1
589590
flang2
590-
ieee_arithmetic
591591
)
592592

593593
# Make sure the compiler is built before we bootstrap
594594
add_dependencies(flang_shared
595595
flang1
596596
flang2
597-
ieee_arithmetic
598597
)
599598

600599
add_dependencies(iso_c_bind

0 commit comments

Comments
 (0)