summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/genie/src/tools/gcc.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/genie/src/tools/gcc.lua')
-rw-r--r--3rdparty/genie/src/tools/gcc.lua68
1 files changed, 61 insertions, 7 deletions
diff --git a/3rdparty/genie/src/tools/gcc.lua b/3rdparty/genie/src/tools/gcc.lua
index 2188bc82070..30a9fa91d91 100644
--- a/3rdparty/genie/src/tools/gcc.lua
+++ b/3rdparty/genie/src/tools/gcc.lua
@@ -43,17 +43,21 @@
local cxxflags =
{
- NoExceptions = "-fno-exceptions",
- NoRTTI = "-fno-rtti",
- UnsignedChar = "-funsigned-char",
+ Cpp11 = "-std=c++11",
+ Cpp14 = "-std=c++14",
+ Cpp17 = "-std=c++17",
+ Cpp20 = "-std=c++20",
+ CppLatest = "-std=c++2b",
+ NoExceptions = "-fno-exceptions",
+ NoRTTI = "-fno-rtti",
+ UnsignedChar = "-funsigned-char",
}
local objcflags =
{
- ObjcARC = "-fobjc-arc",
+ ObjcARC = "-fobjc-arc",
}
-
--
-- Map platforms to flags
--
@@ -106,7 +110,27 @@
cxx = "orbis-clang++",
ar = "orbis-ar",
cppflags = "-MMD -MP",
- }
+ },
+ Emscripten = {
+ cc = "$(EMSCRIPTEN)/emcc",
+ cxx = "$(EMSCRIPTEN)/em++",
+ ar = "$(EMSCRIPTEN)/emar",
+ cppflags = "-MMD -MP",
+ },
+ NX32 = {
+ cc = "clang",
+ cxx = "clang++",
+ ar = "armv7l-nintendo-nx-eabihf-ar",
+ cppflags = "-MMD -MP",
+ flags = "-march=armv7l",
+ },
+ NX64 = {
+ cc = "clang",
+ cxx = "clang++",
+ ar = "aarch64-nintendo-nx-elf-ar",
+ cppflags = "-MMD -MP",
+ flags = "-march=aarch64",
+ },
}
local platforms = premake.gcc.platforms
@@ -169,6 +193,10 @@
end
end
+ if cfg.kind == "Bundle" then
+ table.insert(result, "-bundle")
+ end
+
if cfg.kind == "SharedLib" then
if cfg.system == "macosx" then
table.insert(result, "-dynamiclib")
@@ -202,7 +230,7 @@
function premake.gcc.getlibdirflags(cfg)
local result = { }
for _, value in ipairs(premake.getlinks(cfg, "all", "directory")) do
- table.insert(result, '-L' .. _MAKE.esc(value))
+ table.insert(result, '-L\"' .. value .. '\"')
end
return result
end
@@ -259,6 +287,20 @@
end
--
+-- Get the arguments for whole-archive linking.
+--
+
+ function premake.gcc.wholearchive(lib)
+ if premake.gcc.llvm then
+ return {"-force_load", lib}
+ elseif os.get() == "macosx" then
+ return {"-Wl,-force_load", lib}
+ else
+ return {"-Wl,--whole-archive", lib, "-Wl,--no-whole-archive"}
+ end
+ end
+
+--
-- Get flags for passing to AR before the target is appended to the commandline
-- prj: project
-- cfg: configuration
@@ -336,6 +378,18 @@
end
--
+-- Decorate system include file search paths for the GCC command line.
+--
+
+ function premake.gcc.getsystemincludedirs(includedirs)
+ local result = { }
+ for _,dir in ipairs(includedirs) do
+ table.insert(result, "-isystem \"" .. dir .. "\"")
+ end
+ return result
+ end
+
+--
-- Return platform specific project and configuration level
-- makesettings blocks.
--