Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

links misbehaves with object files ... #8

Open
assarbad opened this issue Jun 6, 2017 · 1 comment
Open

links misbehaves with object files ... #8

assarbad opened this issue Jun 6, 2017 · 1 comment

Comments

@assarbad
Copy link

assarbad commented Jun 6, 2017

The links function blindly appends .lib to the dependencies when the action is one of the vs* values. Unfortunately this collides with the desire to sometimes link to object files provided directly by Microsoft. Examples are thrownew.obj (and nothrownew.obj), hotpatch.obj, pnoarg.obj and setargv.obj (setargv.obj etc). The latter is useful to link POSIX utilities which expect the command line arguments to already be expanded, whereas on Windows the application itself is usually expected to handle wild cards.

As a side-note, my fix to the issue is this one (pure Lua):

    -- Fix up premake.getlinks() to not do stupid stuff with object files we pass
    local orig_premake_getlinks = premake.getlinks
    premake.getlinks = function(cfg, kind, part)
        local origret = orig_premake_getlinks(cfg, kind, part)
        local ret = {}
        for k,v in ipairs(origret) do
            local dep = v:gsub(".obj.lib", ".obj")
            dep = dep:gsub(".lib.lib", ".lib")
            table.insert(ret, dep)
        end
        return ret
    end
@starkos
Copy link
Member

starkos commented Jun 7, 2017

If you can submit that as a PR, I'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants