diff options
Diffstat (limited to '3rdparty/genie/src/tools/gcc.lua')
-rw-r--r-- | 3rdparty/genie/src/tools/gcc.lua | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua index d03c6e411a2..2188bc82070 100644 --- a/3rdparty/genie/src/tools/gcc.lua +++ b/3rdparty/genie/src/tools/gcc.lua @@ -25,19 +25,20 @@ local cflags = { - EnableSSE = "-msse", - EnableSSE2 = "-msse2", - EnableAVX = "-mavx", - EnableAVX2 = "-mavx2", - ExtraWarnings = "-Wall -Wextra", - FatalWarnings = "-Werror", - FloatFast = "-ffast-math", - FloatStrict = "-ffloat-store", - NoFramePointer = "-fomit-frame-pointer", - Optimize = "-O2", - OptimizeSize = "-Os", - OptimizeSpeed = "-O3", - Symbols = "-g", + EnableSSE = "-msse", + EnableSSE2 = "-msse2", + EnableAVX = "-mavx", + EnableAVX2 = "-mavx2", + PedanticWarnings = "-Wall -Wextra -pedantic", + ExtraWarnings = "-Wall -Wextra", + FatalWarnings = "-Werror", + FloatFast = "-ffast-math", + FloatStrict = "-ffloat-store", + NoFramePointer = "-fomit-frame-pointer", + Optimize = "-O2", + OptimizeSize = "-Os", + OptimizeSpeed = "-O3", + Symbols = "-g", } local cxxflags = @@ -47,6 +48,11 @@ UnsignedChar = "-funsigned-char", } + local objcflags = + { + ObjcARC = "-fobjc-arc", + } + -- -- Map platforms to flags @@ -140,6 +146,11 @@ end + function premake.gcc.getobjcflags(cfg) + return table.translate(cfg.flags, objcflags) + end + + -- -- Returns a list of linker flags, based on the supplied configuration. -- @@ -236,6 +247,7 @@ local result = {} for _, value in ipairs(premake.getlinks(cfg, "system", "fullpath")) do if premake.gcc.islibfile(value) then + value = path.rebase(value, cfg.project.location, cfg.location) table.insert(result, _MAKE.esc(value)) elseif path.getextension(value) == ".framework" then table.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value))) @@ -294,13 +306,11 @@ function premake.gcc.getdefines(defines) local result = { } for _,def in ipairs(defines) do - table.insert(result, '-D' .. def) + table.insert(result, "-D" .. def) end return result end - - -- -- Decorate include file search paths for the GCC command line. -- @@ -308,7 +318,7 @@ function premake.gcc.getincludedirs(includedirs) local result = { } for _,dir in ipairs(includedirs) do - table.insert(result, "-I" .. _MAKE.esc(dir)) + table.insert(result, "-I\"" .. dir .. "\"") end return result end @@ -320,7 +330,7 @@ function premake.gcc.getquoteincludedirs(includedirs) local result = { } for _,dir in ipairs(includedirs) do - table.insert(result, "-iquote " .. _MAKE.esc(dir)) + table.insert(result, "-iquote \"" .. dir .. "\"") end return result end |