diff --git a/src/actions/xcode/xcode_common.lua b/src/actions/xcode/xcode_common.lua index 7ee8bced..e4730fb4 100644 --- a/src/actions/xcode/xcode_common.lua +++ b/src/actions/xcode/xcode_common.lua @@ -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;') diff --git a/tests/actions/xcode/test_xcode_project.lua b/tests/actions/xcode/test_xcode_project.lua index a50576b6..0da2976c 100644 --- a/tests/actions/xcode/test_xcode_project.lua +++ b/tests/actions/xcode/test_xcode_project.lua @@ -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()