XMake: Add options to disable tools/plugins and unit tests building

This commit is contained in:
Jérôme Leclercq 2022-01-18 06:15:51 +01:00
parent 025deb9ae1
commit 22c99bfd1d
6 changed files with 168 additions and 141 deletions

View File

@ -63,7 +63,7 @@ jobs:
# Setup compilation mode and install project dependencies # Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies - name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes run: xmake config --shadernodes=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes
# Build the engine # Build the engine
- name: Build Nazara - name: Build Nazara

View File

@ -72,7 +72,7 @@ jobs:
# Setup compilation mode and install project dependencies # Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies - name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes run: xmake config --shadernodes=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes
# Build the engine # Build the engine
- name: Build Nazara - name: Build Nazara

View File

@ -55,7 +55,7 @@ jobs:
# Setup compilation mode and install project dependencies # Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies - name: Configure xmake and install dependencies
run: xmake.exe config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes run: xmake.exe config --shadernodes=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes
# Build the engine # Build the engine
- name: Build Nazara - name: Build Nazara

View File

@ -1,6 +1,14 @@
add_requires("assimp") option("assimp")
set_default(true)
set_showmenu(true)
set_description("Build Assimp plugin")
target("PluginAssimp") option_end()
if has_config("assimp") then
add_requires("assimp")
target("PluginAssimp")
set_kind("shared") set_kind("shared")
set_group("Plugins") set_group("Plugins")
@ -11,3 +19,4 @@ target("PluginAssimp")
add_headerfiles("**.inl") add_headerfiles("**.inl")
add_includedirs(".") add_includedirs(".")
add_files("**.cpp") add_files("**.cpp")
end

View File

@ -1,30 +1,39 @@
if is_mode("asan") then option("tests")
set_default(true)
set_showmenu(true)
set_description("Build unit tests")
option_end()
if has_config("tests") then
if is_mode("asan") then
add_defines("CATCH_CONFIG_NO_WINDOWS_SEH") add_defines("CATCH_CONFIG_NO_WINDOWS_SEH")
add_defines("CATCH_CONFIG_NO_POSIX_SIGNALS") add_defines("CATCH_CONFIG_NO_POSIX_SIGNALS")
end end
add_requires("catch2", "glslang", "spirv-tools") add_requires("catch2", "glslang", "spirv-tools")
-- Common config -- Common config
set_group("Tests") set_group("Tests")
set_kind("binary") set_kind("binary")
add_deps("NazaraCore", "NazaraNetwork", "NazaraPhysics2D", "NazaraShader") add_deps("NazaraCore", "NazaraNetwork", "NazaraPhysics2D", "NazaraShader")
add_packages("catch2", "glslang", "spirv-tools") add_packages("catch2", "glslang", "spirv-tools")
add_headerfiles("Engine/**.hpp") add_headerfiles("Engine/**.hpp")
add_files("resources.cpp") add_files("resources.cpp")
add_files("Engine/**.cpp") add_files("Engine/**.cpp")
add_includedirs(".") add_includedirs(".")
--[[if xmake.version():ge("2.5.9") then --[[if xmake.version():ge("2.5.9") then
add_rules("c++.unity_build") add_rules("c++.unity_build")
end]] end]]
target("NazaraClientUnitTests") target("NazaraClientUnitTests")
add_deps("NazaraAudio") add_deps("NazaraAudio")
add_files("main_client.cpp") add_files("main_client.cpp")
target("NazaraUnitTests") target("NazaraUnitTests")
add_files("main.cpp") add_files("main.cpp")
remove_headerfiles("Engine/Audio/**") remove_headerfiles("Engine/Audio/**")
remove_files("Engine/Audio/**") remove_files("Engine/Audio/**")
end

View File

@ -1,7 +1,14 @@
option("shadernodes")
set_default(false)
set_showmenu(true)
set_description("Build ShaderNodes tool")
add_requires("nodeeditor", "qt5core", "qt5gui", "qt5widgets", {debug = is_mode("debug"), optional = true}) option_end()
rule("qt5.env") if has_config("shadernodes") then
add_requires("nodeeditor", "qt5core", "qt5gui", "qt5widgets", {debug = is_mode("debug")})
rule("qt5.env")
after_load(function (target) after_load(function (target)
-- retrieve qtbase -- retrieve qtbase
local qtdir local qtdir
@ -21,7 +28,7 @@ rule("qt5.env")
end) end)
rule("qt5.moc") rule("qt5.moc")
add_deps("qt5.env") add_deps("qt5.env")
set_extensions(".h", ".hpp") set_extensions(".h", ".hpp")
before_buildcmd_file(function (target, batchcmds, sourcefile, opt) before_buildcmd_file(function (target, batchcmds, sourcefile, opt)
@ -91,7 +98,7 @@ rule("qt5.moc")
batchcmds:set_depcache(target:dependfile(objectfile)) batchcmds:set_depcache(target:dependfile(objectfile))
end) end)
target("NazaraShaderNodes") target("NazaraShaderNodes")
set_group("Tools") set_group("Tools")
set_kind("binary") set_kind("binary")
add_rules("qt5.moc") add_rules("qt5.moc")
@ -106,3 +113,5 @@ target("NazaraShaderNodes")
add_includedirs("../src") add_includedirs("../src")
add_headerfiles("../src/ShaderNode/**.hpp", "../src/ShaderNode/**.inl") add_headerfiles("../src/ShaderNode/**.hpp", "../src/ShaderNode/**.inl")
add_files("../src/ShaderNode/**.cpp") add_files("../src/ShaderNode/**.cpp")
end