summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/genie/src/base/project.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/genie/src/base/project.lua')
-rw-r--r--3rdparty/genie/src/base/project.lua59
1 files changed, 46 insertions, 13 deletions
diff --git a/3rdparty/genie/src/base/project.lua b/3rdparty/genie/src/base/project.lua
index 1fc7375e93e..ad12830ed7b 100644
--- a/3rdparty/genie/src/base/project.lua
+++ b/3rdparty/genie/src/base/project.lua
@@ -463,7 +463,7 @@
-- Fix things up based on the current system
local kind = cfg.kind
- if premake.iscppproject(cfg) then
+ if premake.iscppproject(cfg) or premake.isvalaproject(cfg) then
-- On Windows, shared libraries link against a static import library
if (namestyle == "windows" or system == "windows")
and kind == "SharedLib" and direction == "link"
@@ -506,7 +506,7 @@
ext = ".lib"
end
elseif namestyle == "posix" then
- if kind == "WindowedApp" and system == "macosx" then
+ if kind == "WindowedApp" and system == "macosx" and not cfg.options.SkipBundling then
bundlename = name .. ".app"
bundlepath = path.join(dir, bundlename)
dir = path.join(bundlepath, "Contents/MacOS")
@@ -535,6 +535,34 @@
elseif kind == "SharedLib" then
ext = ".prx"
end
+ elseif namestyle == "TegraAndroid" then
+ -- the .so->.apk happens later for Application types
+ if kind == "ConsoleApp" or kind == "WindowedApp" or kind == "SharedLib" then
+ prefix = "lib"
+ ext = ".so"
+ elseif kind == "StaticLib" then
+ prefix = "lib"
+ ext = ".a"
+ end
+ elseif namestyle == "NX" then
+ -- NOTE: it would be cleaner to just output $(TargetExt) for all cases, but
+ -- there is logic elsewhere that assumes a '.' to be present in target name
+ -- such that it can reverse engineer the extension set here.
+ if kind == "ConsoleApp" or kind == "WindowedApp" then
+ ext = ".nspd_root"
+ elseif kind == "StaticLib" then
+ ext = ".a"
+ elseif kind == "SharedLib" then
+ ext = ".nro"
+ end
+ elseif namestyle == "Emscripten" then
+ if kind == "ConsoleApp" or kind == "WindowedApp" then
+ ext = ".html"
+ elseif kind == "StaticLib" then
+ ext = ".a"
+ elseif kind == "SharedLib" then
+ ext = ".js"
+ end
end
prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix
@@ -567,8 +595,8 @@
-- any relevant command-line options.
--
- function premake.gettool(cfg)
- if premake.iscppproject(cfg) then
+ function premake.gettool(prj)
+ if premake.iscppproject(prj) then
if _OPTIONS.cc then
return premake[_OPTIONS.cc]
end
@@ -577,9 +605,9 @@
return premake[action.valid_tools.cc[1]]
end
return premake.gcc
- elseif premake.isdotnetproject(cfg) then
+ elseif premake.isdotnetproject(prj) then
return premake.dotnet
- elseif premake.isswiftproject(cfg) then
+ elseif premake.isswiftproject(prj) then
return premake.swift
else
return premake.valac
@@ -603,7 +631,7 @@
local fname = path.getname(abspath)
local max = abspath:len() - fname:len()
-
+
-- First check for an exact match from the inverse vpaths
if prj.inversevpaths and prj.inversevpaths[abspath] then
return path.join(prj.inversevpaths[abspath], fname)
@@ -659,7 +687,7 @@
end
end
end
-
+
if #matches > 0 then
-- for the sake of determinism, return the first alphabetically
table.sort(matches)
@@ -703,7 +731,8 @@
--
function premake.project.iscproject(prj)
- return prj.language == "C"
+ local language = prj.language or prj.solution.language
+ return language == "C"
end
@@ -712,7 +741,8 @@
--
function premake.iscppproject(prj)
- return (prj.language == "C" or prj.language == "C++")
+ local language = prj.language or prj.solution.language
+ return (language == "C" or language == "C++")
end
@@ -722,7 +752,8 @@
--
function premake.isdotnetproject(prj)
- return (prj.language == "C#")
+ local language = prj.language or prj.solution.language
+ return (language == "C#")
end
--
@@ -730,7 +761,8 @@
--
function premake.isvalaproject(prj)
- return (prj.language == "Vala")
+ local language = prj.language or prj.solution.language
+ return (language == "Vala")
end
--
@@ -738,5 +770,6 @@
--
function premake.isswiftproject(prj)
- return (prj.language == "Swift")
+ local language = prj.language or prj.solution.language
+ return (language == "Swift")
end