This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/modules/xcode/_preload.lua
Tom van Dijck 694f934693 Merge pull request #755 from Blizzard/fix-supported-languages
Add 'supports_language' callback to action
2017-04-24 13:54:53 -07:00

70 lines
1.3 KiB
Lua

---
-- xcode/_preload.lua
-- Define the Apple XCode actions and new APIs.
-- Copyright (c) 2009-2015 Jason Perkins and the Premake project
---
local p = premake
--
-- Register new Xcode-specific project fields.
--
p.api.register {
name = "xcodebuildsettings",
scope = "config",
kind = "key-array",
}
p.api.register {
name = "xcodebuildresources",
scope = "config",
kind = "list",
}
--
-- Register the Xcode exporters.
--
newaction {
trigger = "xcode4",
shortname = "Apple Xcode 4",
description = "Generate Apple Xcode 4 project files",
-- Xcode always uses Mac OS X path and naming conventions
targetos = "macosx",
-- The capabilities of this action
valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib", "Makefile", "None" },
valid_tools = {
cc = { "gcc", "clang" },
},
supports_language = function(lang)
return p.languages.isc(lang) or
p.languages.iscpp(lang)
end,
-- Workspace and project generation logic
onWorkspace = function(wks)
p.generate(wks, ".xcworkspace/contents.xcworkspacedata", p.modules.xcode.generateWorkspace)
end,
onProject = function(prj)
p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode.generateProject)
end,
}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return (_ACTION == "xcode4")
end