diff --git a/src/tools/clang.lua b/src/tools/clang.lua index fd4bc5c7..af0cd7d8 100644 --- a/src/tools/clang.lua +++ b/src/tools/clang.lua @@ -214,8 +214,10 @@ if tool == "ar" then return "ar" - else + elseif tool == "cc" then return "clang" + elseif tool == "cxx" then + return "clang++" end end diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index ac905106..77f5c5ee 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -96,6 +96,7 @@ Strict = "-ffloat-store", }, optimize = { + Off = "-O0", On = "-O2", Size = "-Os", Speed = "-O3", diff --git a/tests/actions/make/cpp/test_clang.lua b/tests/actions/make/cpp/test_clang.lua index 68ff89e3..89425ff6 100644 --- a/tests/actions/make/cpp/test_clang.lua +++ b/tests/actions/make/cpp/test_clang.lua @@ -32,7 +32,7 @@ test.capture [[ ifeq ($(config),debug) CC = clang - CXX = clang + CXX = clang++ AR = ar ]] end diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index c708d7cb..4514c5a4 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -114,6 +114,11 @@ test.isequal({ "-msse2" }, gcc.getcflags(cfg)) end + function suite.cflags_onNoOptimize() + optimize "Off" + prepare() + test.isequal({ "-O0" }, gcc.getcflags(cfg)) + end -- -- Check the translation of CXXFLAGS.