-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from qudix/dev/xmake
Add `xmake` build support
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
-- set project | ||
set_project("nifly") | ||
set_languages("c++17") | ||
set_license("GPL-3.0") | ||
|
||
-- define options | ||
option("tests", { default = false, description = "Enable tests" }) | ||
|
||
-- require packages | ||
add_requires("half", "miniball") | ||
|
||
if has_config("tests") then | ||
add_requires("catch2 v2.13.10") | ||
end | ||
|
||
-- define targets | ||
target("nifly", function() | ||
set_kind("static") | ||
|
||
-- bind package dependencies | ||
add_packages("half", "miniball", { public = true }) | ||
|
||
-- add all source files | ||
add_files("src/**.cpp") | ||
|
||
-- add all header files | ||
add_includedirs("include", { public = true }) | ||
add_headerfiles("include/(**.hpp)", { prefixdir = "nifly" }) | ||
|
||
-- add flags | ||
add_cxxflags("cl::/Zc:inline", "cl::/bigobj") | ||
end) | ||
|
||
if has_config("tests") then | ||
target("nifly-tests", function() | ||
-- add target dependencies | ||
add_deps("nifly") | ||
|
||
-- bind package dependencies | ||
add_packages("catch2") | ||
|
||
-- add all source files, except TestNifFileOptional | ||
add_files("tests/*.cpp|TestNifFileOptional.cpp") | ||
|
||
-- add all header files | ||
add_includedirs("tests") | ||
|
||
-- set run directory | ||
set_rundir("tests") | ||
end) | ||
end |