From ced58a047d84c7dbb79eab91d1980f46d9b6e24c Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Mon, 16 May 2022 23:42:06 -0500 Subject: [PATCH] CMake: Set fp-contract=fast Clang defaults to off, everyone else defaults to on or fast. Allows multiplies and adds to be merged into fma --- pcsx2/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 48b6d3d2f7..29e3e74f20 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -38,8 +38,13 @@ if(NOT TOP_CMAKE_WAS_SOURCED) It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") endif() -if(NOT MSVC) +if(MSVC) + if (MSVC_VERSION GREATER_EQUAL 1930) + target_compile_options(PCSX2_FLAGS INTERFACE /fp:contract) + endif() +else() target_compile_options(PCSX2_FLAGS INTERFACE + -ffp-contract=fast -fno-strict-aliasing -Wstrict-aliasing # Allow to track strict aliasing issue. -Wno-parentheses