Skip to content

Commit 6b55368

Browse files
committed
Add workaround for ninja
1 parent 596dffb commit 6b55368

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

runtime/flang/CMakeLists.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ endif()
514514

515515
set_target_properties(flang_static PROPERTIES Fortran_MODULE_DIRECTORY ${FLANG_MODULE_DIRECTORY_STATIC})
516516

517+
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja")
517518
# State the module that the source is producing
518519
set_source_files_properties(
519520
iso_c_bind_static.F95
@@ -528,6 +529,25 @@ set_source_files_properties(
528529
PROPERTIES
529530
OBJECT_DEPENDS ${FLANG_MODULE_DIRECTORY_STATIC}/iso_c_binding.mod
530531
)
532+
else()
533+
add_library(iso_c_bind OBJECT
534+
iso_c_bind.F95
535+
)
536+
add_library(ieee_arithmetic OBJECT
537+
ieee_arithmetic.F95
538+
ieee_exceptions.F95
539+
)
540+
add_dependencies(iso_c_bind
541+
flang1
542+
flang2
543+
)
544+
add_dependencies(ieee_arithmetic
545+
iso_c_bind
546+
)
547+
add_dependencies(flang_static
548+
ieee_arithmetic
549+
)
550+
endif()
531551

532552
set(SHARED_LIBRARY TRUE)
533553

@@ -547,6 +567,7 @@ else()
547567
endif()
548568
set_target_properties(flang_shared PROPERTIES Fortran_MODULE_DIRECTORY ${FLANG_MODULE_DIRECTORY_SHARED})
549569

570+
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja")
550571
# State the module that the source is producing
551572
set_source_files_properties(
552573
iso_c_bind.F95
@@ -561,7 +582,11 @@ set_source_files_properties(
561582
PROPERTIES
562583
OBJECT_DEPENDS ${FLANG_MODULE_DIRECTORY_SHARED}/iso_c_binding.mod
563584
)
564-
585+
else()
586+
add_dependencies(flang_shared
587+
ieee_arithmetic
588+
)
589+
endif()
565590
set(SHARED_LIBRARY FALSE)
566591

567592
set_property(

0 commit comments

Comments
 (0)