Skip to content

Possibility of using clang to compile but MSVC as linker #4733

Answered by ifarbod
ifarbod asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to fix it.

target("xmake-linker")
    set_kind("binary")

    set_languages("cxx20")

    if is_plat("windows") then
        add_defines("UNICODE", "_UNICODE")
        add_rules("win.sdk.application")
        -- Hide the path to our PDB like MSFT
        add_ldflags("link::/pdbaltpath:%_PDB%", {force = true})

        -- xmake doesn't add these for you
        add_ldflags("link::/ENTRY:wWinMainCRTStartup", {force = true})
        add_syslinks("libcmt")
    end

    add_files("**.cpp")

But I think XMake should take care of something like this

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
9 replies
@waruqi
Comment options

@ifarbod
Comment options

@waruqi
Comment options

@ifarbod
Comment options

Answer selected by ifarbod
Comment options

You must be logged in to vote
1 reply
@waruqi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants