Skip to content

Commit 28686b4

Browse files
kaadamkiranchandramohan
authored andcommitted
win: 'ffast-math' option is not recognized by clang-cl
Needs to use '/fp:fast' compiler option instead.
1 parent 9e2defb commit 28686b4

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

runtime/flang/CMakeLists.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,21 @@ set_property(
560560
PG_PIC
561561
)
562562

563-
set_source_files_properties(
564-
${I8_FILES_DIR}/red_norm2_stride1.c
565-
red_norm2_stride1.c
566-
PROPERTIES
567-
COMPILE_FLAGS "-ffast-math"
568-
)
563+
if (NOT MSVC OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "GNU")
564+
set_source_files_properties(
565+
${I8_FILES_DIR}/red_norm2_stride1.c
566+
red_norm2_stride1.c
567+
PROPERTIES
568+
COMPILE_FLAGS "-ffast-math"
569+
)
570+
else()
571+
set_source_files_properties(
572+
${I8_FILES_DIR}/red_norm2_stride1.c
573+
red_norm2_stride1.c
574+
PROPERTIES
575+
COMPILE_FLAGS "/fp:fast"
576+
)
577+
endif()
569578

570579
## CMake does not handle module dependencies between Fortran files,
571580
## unless using the Ninja generator, we need to help it

0 commit comments

Comments
 (0)