summaryrefslogtreecommitdiff
path: root/xmake/modules/package/manager
diff options
context:
space:
mode:
authorMeanSquaredError <[email protected]>2025-11-20 17:16:42 +0200
committerMeanSquaredError <[email protected]>2025-11-23 18:36:20 +0200
commit5045cb0b591c9bcd50cd09d040d56dbd8fbeee70 (patch)
tree806288546c91c226dd8f2aa6ad5c420b88e570f6 /xmake/modules/package/manager
parent4a3e993297b57f6c725690b26a81ecf5ad9c087e (diff)
cmake find_package: Add configuration option allow_empty_package that allows system packages that don't need any include directories or linked libraries.
Diffstat (limited to 'xmake/modules/package/manager')
-rw-r--r--xmake/modules/package/manager/cmake/configurations.lua1
-rw-r--r--xmake/modules/package/manager/cmake/find_package.lua2
2 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/cmake/configurations.lua b/xmake/modules/package/manager/cmake/configurations.lua
index e0a9f7d9a..9945ca191 100644
--- a/xmake/modules/package/manager/cmake/configurations.lua
+++ b/xmake/modules/package/manager/cmake/configurations.lua
@@ -29,6 +29,7 @@ function main()
moduledirs = {description = "Set the cmake modules directories."},
presets = {description = "Set the preset values, e.g. {Boost_USE_STATIC_LIB = true}"},
envs = {description = "Set the run environments of cmake, e.g. {CMAKE_PREFIX_PATH = \"xxx\"}"},
+ allow_empty_package = {description = "Accept package even if it doesn't have any include directories or linked libraries"},
}
end
diff --git a/xmake/modules/package/manager/cmake/find_package.lua b/xmake/modules/package/manager/cmake/find_package.lua
index f1b4cd321..376b583dd 100644
--- a/xmake/modules/package/manager/cmake/find_package.lua
+++ b/xmake/modules/package/manager/cmake/find_package.lua
@@ -301,7 +301,7 @@ function _find_package(cmake, name, opt)
os.tryrm(workdir)
-- get results
- if links or includedirs then
+ if configs.allow_empty_package or links or includedirs then
local results = {}
results.links = table.reverse_unique(links)
results.ldflags = table.reverse_unique(ldflags)