From 0a8048809c014bf41fa4c50f0cff4fc689832635 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Mon, 10 Oct 2022 08:49:52 +0200 Subject: [PATCH] XMake: simplifies option syntax --- examples/xmake.lua | 7 +------ plugins/Assimp/xmake.lua | 7 +------ plugins/FFmpeg/xmake.lua | 7 +------ tests/xmake.lua | 7 +------ tools/shadernodes.lua | 7 +------ xmake.lua | 41 ++++++---------------------------------- 6 files changed, 11 insertions(+), 65 deletions(-) diff --git a/examples/xmake.lua b/examples/xmake.lua index 3802d141d..2e114e9dd 100644 --- a/examples/xmake.lua +++ b/examples/xmake.lua @@ -1,9 +1,4 @@ -option("examples") - set_default(true) - set_showmenu(true) - set_description("Build examples") - -option_end() +option("examples", { description = "Build examples", default = true }) if has_config("examples") then -- Common config diff --git a/plugins/Assimp/xmake.lua b/plugins/Assimp/xmake.lua index 9ef5aaff0..f8829271b 100644 --- a/plugins/Assimp/xmake.lua +++ b/plugins/Assimp/xmake.lua @@ -1,9 +1,4 @@ -option("assimp") - set_default(true) - set_showmenu(true) - set_description("Build Assimp plugin") - -option_end() +option("assimp", { description = "Build Assimp plugin", default = true }) if has_config("assimp") then add_requires("assimp v5.2.3") diff --git a/plugins/FFmpeg/xmake.lua b/plugins/FFmpeg/xmake.lua index caa75bbd0..5c113f1b2 100644 --- a/plugins/FFmpeg/xmake.lua +++ b/plugins/FFmpeg/xmake.lua @@ -1,9 +1,4 @@ -option("ffmpeg") - set_default(false) - set_showmenu(true) - set_description("Build FFmpeg plugin") - -option_end() +option("ffmpeg", { description = "Build FFmpeg plugin", default = false }) if has_config("ffmpeg") then add_requires("ffmpeg", { configs = { shared = true } }) diff --git a/tests/xmake.lua b/tests/xmake.lua index 2d0926002..bbf6b9847 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -1,9 +1,4 @@ -option("tests") - set_default(false) - set_showmenu(true) - set_description("Build unit tests") - -option_end() +option("tests", { description = "Build unit tests", default = false }) if has_config("tests") then if is_mode("asan") then diff --git a/tools/shadernodes.lua b/tools/shadernodes.lua index 41c72d623..d9f229b61 100644 --- a/tools/shadernodes.lua +++ b/tools/shadernodes.lua @@ -1,9 +1,4 @@ -option("shadernodes") - set_default(false) - set_showmenu(true) - set_description("Build ShaderNodes tool") - -option_end() +option("shadernodes", { description = "Build ShaderNodes tool (requires Qt)", default = false }) if has_config("shadernodes") then add_requires("nodeeditor", "qt5core", "qt5gui", "qt5widgets", {debug = is_mode("debug")}) diff --git a/xmake.lua b/xmake.lua index 9a2a9f971..412f6ec1d 100644 --- a/xmake.lua +++ b/xmake.lua @@ -133,41 +133,12 @@ NazaraModules = modules includes("xmake/**.lua") -option("compile_shaders") - set_default(true) - set_showmenu(true) - set_description("Compile nzsl shaders into an includable binary version") -option_end() - -option("embed_rendererbackends") - set_default(false) - set_showmenu(true) - set_description("Embed renderer backend code into NazaraRenderer instead of loading them dynamically") -option_end() - -option("embed_resources") - set_default(true) - set_showmenu(true) - set_description("Turn builtin resources into includable headers") -option_end() - -option("override_runtime") - set_default(true) - set_showmenu(true) - set_description("Override vs runtime to MD in release and MDd in debug") -option_end() - -option("usepch") - set_default(false) - set_showmenu(true) - set_description("Use precompiled headers to speedup compilation") -option_end() - -option("unitybuild") - set_default(false) - set_showmenu(true) - set_description("Build the engine using unity build") -option_end() +option("compile_shaders", { description = "Compile nzsl shaders into an includable binary version", default = true }) +option("embed_rendererbackends", { description = "Embed renderer backend code into NazaraRenderer instead of loading them dynamically", default = false }) +option("embed_resources", { description = "Turn builtin resources into includable headers", default = true }) +option("override_runtime", { description = "Override vs runtime to MD in release and MDd in debug", default = true }) +option("usepch", { description = "Use precompiled headers to speedup compilation", default = false }) +option("unitybuild", { description = "Build the engine using unity build", default = false }) set_project("NazaraEngine") set_xmakever("2.6.3")