forked from DaanDeMeyer/reproc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
32 lines (32 loc) · 960 Bytes
/
xmake.lua
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
target("reproc")
_config_project({
project_kind = "static"
})
add_headerfiles("reproc/include/**.h")
add_headerfiles("reproc++/include/**.hpp")
add_includedirs("reproc/include/", "reproc++/include/", {
public = true
})
add_rules("c++.build", "c.build")
on_config(function(target)
local src_path = path.join(os.scriptdir(), "reproc/src")
local keyword
if is_plat("windows") then
keyword = ".windows"
else
keyword = ".posix"
end
for _, filepath in ipairs(os.files(path.join(src_path, "*.c"))) do
local file_name = path.filename(filepath)
file_name = file_name:sub(1, #file_name - 2)
local ext = path.extension(file_name)
if (#ext == 0 or ext == keyword) then
target:add("files", filepath)
end
end
if is_plat("windows") then
target:add("links", "ws2_32", {public = true})
end
end)
add_files("reproc++/src/reproc.cpp")
target_end()