Skip to content

Commit

Permalink
Merge pull request #11287 from rouault/fix_11286
Browse files Browse the repository at this point in the history
CMake: use add_compile_options() instead of setting CMAKE_CXX_FLAGS for -fno-finite-math-only
  • Loading branch information
rouault authored Nov 16, 2024
2 parents eebbd64 + 91f7420 commit f84b0b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/helpers/GdalCompilationFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM" OR CMAKE_CXX_COMPILER_ID STREQUAL
check_cxx_compiler_flag(-fno-finite-math-only HAVE_FLAG_NO_FINITE_MATH_ONLY)
if (HAVE_FLAG_NO_FINITE_MATH_ONLY)
# Intel CXX compiler based on clang defaults to -ffinite-math-only, which breaks std::isinf(), std::isnan(), etc.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-finite-math-only")
add_compile_options("-fno-finite-math-only")
endif ()

set(TEST_LINK_STDCPP_SOURCE_CODE
Expand Down

0 comments on commit f84b0b9

Please sign in to comment.