diff options
| -rw-r--r-- | xmake/modules/package/manager/cmake/configurations.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/package/manager/cmake/find_package.lua | 2 |
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) |
