Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiam Devine <dmail00@gmail.com>2011-03-11 19:43:19 +0300
committerLiam Devine <dmail00@gmail.com>2011-03-11 19:43:19 +0300
commit2b95fc299c0b9ae359fbe3587c497889222cd63b (patch)
treee5d0b374650b45398750e1cb0db390eb40002f61 /src
parent2e9fbb9962fddcf45598f021c60afa153dc660a8 (diff)
Xcode4 workspace initial
Diffstat (limited to 'src')
-rw-r--r--src/_manifest.lua3
-rw-r--r--src/actions/xcode/_xcode.lua53
-rw-r--r--src/actions/xcode/xcode4_workspace.lua38
3 files changed, 94 insertions, 0 deletions
diff --git a/src/_manifest.lua b/src/_manifest.lua
index 7be11fa..dbfe02e 100644
--- a/src/_manifest.lua
+++ b/src/_manifest.lua
@@ -66,6 +66,9 @@
"actions/xcode/xcode_common.lua",
"actions/xcode/xcode_project.lua",
+ -- Xcode4 action
+ "actions/xcode/xcode4_workspace.lua",
+
-- Clean action
"actions/clean/_clean.lua",
}
diff --git a/src/actions/xcode/_xcode.lua b/src/actions/xcode/_xcode.lua
index 7ba4e15..4ff680e 100644
--- a/src/actions/xcode/_xcode.lua
+++ b/src/actions/xcode/_xcode.lua
@@ -56,3 +56,56 @@
end
end,
}
+
+ newaction
+ {
+ trigger = "xcode4",
+ shortname = "Xcode 4",
+ description = "Generate Apple Xcode 4 project files (experimental)",
+ os = "macosx",
+
+ valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ },
+
+ valid_platforms = {
+ Native = "Native",
+ x32 = "Native 32-bit",
+ x64 = "Native 64-bit",
+ Universal32 = "32-bit Universal",
+ Universal64 = "64-bit Universal",
+ Universal = "Universal",
+ },
+
+ default_platform = "Universal",
+
+ onsolution = function(sln)
+ -- Assign IDs needed for inter-project dependencies
+ premake.xcode.preparesolution(sln)
+ end,
+
+ onproject = function(prj)
+ premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project)
+ end,
+
+ oncleanproject = function(prj)
+ premake.clean.directory(prj, "%%.xcodeproj")
+ end,
+
+ oncheckproject = function(prj)
+ -- Xcode can't mix target kinds within a project
+ local last
+ for cfg in premake.eachconfig(prj) do
+ if last and last ~= cfg.kind then
+ error("Project '" .. prj.name .. "' uses more than one target kind; not supported by Xcode", 0)
+ end
+ last = cfg.kind
+ end
+ end,
+ }
+
+
diff --git a/src/actions/xcode/xcode4_workspace.lua b/src/actions/xcode/xcode4_workspace.lua
new file mode 100644
index 0000000..93216a2
--- /dev/null
+++ b/src/actions/xcode/xcode4_workspace.lua
@@ -0,0 +1,38 @@
+premake.xcode4 = {}
+
+local xcode4 = premake.xcode4
+
+function xcode4.workspace_head()
+ _p('<?xml version="1.0" encoding="UTF-8"?>')
+ _p('<Workspace')
+ _p(1,'version = "1.0">')
+
+end
+
+function xcode4.workspace_tail()
+ _p('</Workspace>')
+end
+
+function xcode4.workspace_file_ref(prj)
+
+ local projpath = path.getrelative(prj.solution.location, prj.location)
+ if projpath == '.' then projpath = '' end
+ _p(1,'<FileRef')
+ _p(2,'location = "group:%s">',projpath .. prj.name .. '.xcodeproj')
+ _p(1,'</FileRef>')
+end
+
+function xcode4.workspace_generate(sln)
+ premake.xcode.preparesolution(sln)
+
+ xcode4.workspace_head()
+
+ for prj in premake.solution.eachproject(sln) do
+ xcode4.workspace_file_ref(prj)
+ end
+
+ xcode4.workspace_tail()
+end
+
+
+