From 690dee040513f364b570b8906b3ca08627bed4e7 Mon Sep 17 00:00:00 2001 From: Sam Surtees Date: Mon, 10 Apr 2017 01:41:18 +1000 Subject: [PATCH 1/2] Fixed issue with Clang not actually supporting floatingpoint 'strict' --- src/tools/clang.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/clang.lua b/src/tools/clang.lua index 282f7d28..2928fcb5 100644 --- a/src/tools/clang.lua +++ b/src/tools/clang.lua @@ -44,7 +44,9 @@ clang.shared = { architecture = gcc.shared.architecture, flags = gcc.shared.flags, - floatingpoint = gcc.shared.floatingpoint, + floatingpoint = { + Fast = "-ffast-math", + }, strictaliasing = gcc.shared.strictaliasing, optimize = { Off = "-O0", From a24f5c1e9bc8c0656927a9e47baeb0f72672e384 Mon Sep 17 00:00:00 2001 From: Sam Surtees Date: Mon, 10 Apr 2017 01:51:30 +1000 Subject: [PATCH 2/2] Fixed issue where VS2010+ projects didn't support floatingpoint 'Default' --- src/actions/vstudio/vs2010_vcxproj.lua | 2 +- tests/actions/vstudio/vc2010/test_floatingpoint.lua | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 0b160374..c4be0603 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -1352,7 +1352,7 @@ function m.floatingPointModel(cfg) - if cfg.floatingpoint then + if cfg.floatingpoint and cfg.floatingpoint ~= "Default" then m.element("FloatingPointModel", nil, cfg.floatingpoint) end end diff --git a/tests/actions/vstudio/vc2010/test_floatingpoint.lua b/tests/actions/vstudio/vc2010/test_floatingpoint.lua index abd65b59..1816ff24 100644 --- a/tests/actions/vstudio/vc2010/test_floatingpoint.lua +++ b/tests/actions/vstudio/vc2010/test_floatingpoint.lua @@ -30,7 +30,7 @@ function suite.floatingPoint_onFloatFast() - flags "FloatFast" + floatingpoint "fast" prepare() test.capture [[ Fast @@ -38,12 +38,15 @@ end function suite.floatingPoint_onFloatStrict() - flags "FloatStrict" + floatingpoint "strict" prepare() test.capture [[ Strict ]] end - - + function suite.floatingPoint_onDefault() + floatingpoint "Default" + prepare() + test.isemptycapture() + end