[feat] add portable build storage mode, refs #80

This commit is contained in:
dijunkun
2026-05-20 23:53:13 +08:00
parent a3aedcb624
commit 515d517a99
5 changed files with 196 additions and 3 deletions
+8 -1
View File
@@ -23,6 +23,12 @@ function setup_options_and_dependencies()
set_description("Enable DRM capture on Linux (assumes dependencies are installed)")
option_end()
option("CROSSDESK_PORTABLE")
set_default(false)
set_showmenu(true)
set_description("Build CrossDesk as a portable package that stores data beside the executable")
option_end()
add_rules("mode.release", "mode.debug")
set_languages("c++17")
set_encodings("utf-8")
@@ -35,6 +41,7 @@ function setup_options_and_dependencies()
add_defines("USE_CUDA=" .. (is_config("USE_CUDA", true) and "1" or "0"))
add_defines("USE_WAYLAND=" .. (is_config("USE_WAYLAND", true) and "1" or "0"))
add_defines("USE_DRM=" .. (is_config("USE_DRM", true) and "1" or "0"))
add_defines("CROSSDESK_PORTABLE=" .. (is_config("CROSSDESK_PORTABLE", true) and "1" or "0"))
if is_mode("debug") then
add_defines("CROSSDESK_DEBUG")
@@ -47,4 +54,4 @@ function setup_options_and_dependencies()
add_requires("nlohmann_json 3.11.3")
add_requires("cpp-httplib v0.26.0", {configs = {ssl = true}})
add_requires("tinyfiledialogs 3.15.1")
end
end
+9 -1
View File
@@ -25,6 +25,14 @@ function setup_targets()
add_files("src/path_manager/*.cpp")
add_includedirs("src/path_manager", {public = true})
target("path_manager_portable_test")
set_kind("binary")
set_default(false)
add_defines("CROSSDESK_PORTABLE=1")
add_includedirs("src/path_manager")
add_files("tests/path_manager_portable_test.cpp",
"src/path_manager/path_manager.cpp")
target("screen_capturer")
set_kind("object")
add_deps("rd_log", "common")
@@ -195,4 +203,4 @@ function setup_targets()
add_deps("wgc_plugin", "crossdesk_service", "crossdesk_session_helper")
add_files("scripts/windows/crossdesk.rc")
end
end
end