Skip to content

使用before_Link自定义链接顺序并未奏效 #5181

Answered by star-hengxing
Jackey990709 asked this question in Q&A
Discussion options

You must be logged in to vote

@Jackey990709

target("main")
    set_kind("binary")
    add_files("src/*.c")

    before_link(function (target)
        local objectfiles = target:objectfiles()
        local tmp = objectfiles[1]
        objectfiles[1] = objectfiles[2]
        objectfiles[2] = tmp
    end)

这里当成指针用应该就行了

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
12 replies
@Jackey990709
Comment options

@Jackey990709
Comment options

@waruqi
Comment options

@star-hengxing
Comment options

@waruqi
Comment options

Comment options

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

Comment options

You must be logged in to vote
0 replies
Answer selected by Jackey990709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants