summaryrefslogtreecommitdiff
path: root/tests/projects/nim/link_library/xmake.lua
blob: ba56fcbf24a61b28098be50d5cf430d9605b0549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
set_project("link_libs")
add_rules("mode.debug", "mode.release")

add_requires("zlib", {system = false, configs = {shared = true}})
add_requires("stb", {system = false})

target("headers")
    set_kind("headeronly")
    add_headerfiles("headers/*.h")
    add_includedirs("headers", {public = true})

target("executablestatic")
    set_kind("binary")
    add_files("mainlib.nim")
    add_deps("staticlib")
    add_packages("zlib", "stb", {public = true})
    if is_plat("linux") then
        add_syslinks("pthread", "m")
    end

target("executableshared")
    set_kind("binary")
    add_files("maindll.nim")
    add_deps("sharedlib")
    if is_plat("linux") then
        add_syslinks("pthread", "m")
    end

target("staticlib")
    set_kind("static")
    add_files("static.nim")
    add_includedirs("inc", {public = true})
    add_headerfiles("inc/*.h")
    if is_plat("linux") then
        add_syslinks("pthread", "m")
    end
    add_deps("headers")

target("sharedlib")
    set_kind("shared")
    add_files("shared.nim")
    add_includedirs("inc", {public = true})
    add_headerfiles("inc/*.h")
    if is_plat("linux") then
        add_syslinks("pthread", "m")
    end
    add_deps("headers")