Fixed naming of static libraries in Xcode

This commit is contained in:
starkos 2009-09-21 13:59:25 +00:00
parent 72682355c3
commit 3f3cabd28f
5 changed files with 53 additions and 8 deletions

View File

@ -21,7 +21,7 @@ solution "PremakeTestbox"
include "CppSharedLib"
include "CppStaticLib"
if _ACTION ~= "codeblocks" and _ACTION ~= "codelite" then
if premake.action.supports(premake.action.current(), "C#") then
include "CsSharedLib"
include "CsConsoleApp"
end

View File

@ -13,7 +13,7 @@
description = "Apple Xcode 3 (experimental)",
os = "macosx",
valid_kinds = { "ConsoleApp", "WindowedApp" },
valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" },
valid_languages = { "C", "C++" },

View File

@ -35,8 +35,8 @@
if #tr.children == 1 then
tr = tr.children[1]
tr.parent = nil
tr.solution = sln
end
tr.solution = sln
-- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
-- to Xcode's display layout (MainMenu.xib/English).
@ -345,8 +345,6 @@
-- Strangely, targets are specified relative to the project.pbxproj file
-- rather than the .xcodeproj directory like the rest of the files.
local basepath = path.join(node.cfg.project.solution.location, "project.pbxproj")
-- local projpath = path.join(node.cfg.project.location, node.cfg.buildtarget.rootdir)
-- local targpath = path.join(path.getrelative(basepath, projpath), node.cfg.buildtarget.root)
local targpath = path.getrelative(basepath, node.cfg.buildtarget.bundlepath)
_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = %s; path = %s; sourceTree = BUILT_PRODUCTS_DIR; };',
node.id, node.name, xcode.gettargettype(node), node.name, targpath)
@ -573,7 +571,8 @@
_p(4,'INFOPLIST_FILE = %s;', target.prjnode.infoplist.path)
end
_p(4,'PRODUCT_NAME = %s;', cfg.buildtarget.name)
_p(4,'PRODUCT_NAME = %s;', cfg.buildtarget.basename)
_p(4,'SYMROOT = %s;', xcode.rebase(prj, cfg.objectsdir))
_p(3,'};')
_p(3,'name = %s;', cfg.name)

View File

@ -112,3 +112,29 @@
return premake.action.list[keys[i]]
end
end
--
-- Determines if an action supports a particular language or target type.
--
-- @param action
-- The action to test.
-- @param feature
-- The feature to check, either a programming language or a target type.
-- @returns
-- True if the feature is supported, false otherwise.
--
function premake.action.supports(action, feature)
if action.valid_languages then
if table.contains(action.valid_languages, feature) then
return true
end
end
if action.valid_kinds then
if table.contains(action.valid_kinds, feature) then
return true
end
end
return false
end

View File

@ -687,7 +687,7 @@
end
function T.xcode3.XCBuildConfigurationBlock_OnDefaults()
function T.xcode3.XCBuildConfigurationBlock_OnConsoleAppDefaults()
Call_XCBuildConfigurationBlock()
test.capture [[
[MyProject:Debug] /* Debug */ = {
@ -706,6 +706,26 @@
end
function T.xcode3.XCBuildConfigurationBlock_OnStaticLibDefaults()
kind "StaticLib"
Call_XCBuildConfigurationBlock()
test.capture [[
[libMyProject.a:Debug] /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CONFIGURATION_BUILD_DIR = .;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
PRODUCT_NAME = MyProject;
SYMROOT = obj/Debug;
};
name = Debug;
};
]]
end
function T.xcode3.XCBuildConfigurationBlock_OnInfoPlist()
files { "Info.plist" }
Call_XCBuildConfigurationBlock()