Added linking to system libraries

This commit is contained in:
starkos 2009-12-03 15:27:13 +00:00
parent fcff55ee47
commit c858deabdd
2 changed files with 39 additions and 3 deletions

View File

@ -675,9 +675,19 @@
table.insert(flags, "-fomit-frame-pointer")
end
flags = table.join(flags, cfg.buildoptions)
xcode.printlist(flags, 'OTHER_CFLAGS')
xcode.printlist(cfg.linkoptions, 'OTHER_LDFLAGS')
-- build list of "other" linked flags. All libraries that aren't frameworks
-- are listed here, so I don't have to try and figure out if they are ".a"
-- or ".dylib", which Xcode requires to list in the Frameworks section
flags = { }
for _, lib in ipairs(premake.getlinks(cfg, "system")) do
if not xcode.isframework(lib) then
table.insert(flags, "-l" .. lib)
end
end
flags = table.join(flags, cfg.linkoptions)
xcode.printlist(flags, 'OTHER_LDFLAGS')
_p(4,'PREBINDING = NO;')

View File

@ -61,7 +61,7 @@
function suite.PBXBuildFile_ListsFrameworks()
links { "Cocoa.framework" }
links { "Cocoa.framework", "ldap" }
prepare()
xcode.PBXBuildFile(tr)
test.capture [[
@ -901,6 +901,32 @@
end
function suite.XCBuildConfigurationProject_OnLinks()
links { "Cocoa.framework", "ldap" }
prepare()
xcode.XCBuildConfiguration_Project(tr, premake.getconfig(tr.project, "Debug"))
test.capture [[
[MyProject:Debug(2)] /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = "obj/Debug";
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-lldap",
);
PREBINDING = NO;
};
name = Debug;
};
]]
end
function suite.XCBuildConfigurationProject_OnLinkOptions()
linkoptions { "link option 1", "link option 2" }
prepare()