File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,12 +233,14 @@ else()
233233 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-model=precise" )
234234
235235 # On clang 14 and later we can turn off float contraction through a pragma, older versions and deterministic versions need it off always, see Core.h
236- if (CMAKE_CXX_COMPILER_VERSION LESS 14 OR CROSS_PLATFORM_DETERMINISTIC)
236+ # clang on LoongArch does not support such pragma, also turn off contraction for it.
237+ if (CMAKE_CXX_COMPILER_VERSION LESS 14 OR CROSS_PLATFORM_DETERMINISTIC OR "${CMAKE_SYSTEM_PROCESSOR} " MATCHES "loongarch" )
237238 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-contract=off" )
238239
239240 # emcc complains with: warning: overriding '-ffp-model=precise' option with '-ffp-contract=off' [-Woverriding-option],
241+ # clang > 19 also report this as an error,
240242 # but this is exactly what we want.
241- if (EMSCRIPTEN)
243+ if (EMSCRIPTEN OR CMAKE_CXX_COMPILER_VERSION GREATER 19 )
242244 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overriding-option" )
243245 endif ()
244246 endif ()
You can’t perform that action at this time.
0 commit comments