diff options
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_library.lua | 6 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_package.lua | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua index 9cd12556d..4e173fc54 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua @@ -38,10 +38,10 @@ local find_file = import("lib.detect.find_file") -- get link name from the file name function sandbox_lib_detect_find_library._link(filename) - -- get link - local link, count = filename:gsub(target.filename("([%w%-_]+)", "static"):gsub("%.", "%%.") .. "$", "%1") + -- get link, @note need %%w to escape to %w because gsub was called in target.filename + local link, count = filename:gsub(target.filename("([%%w%%-_]+)", "static"):gsub("%.", "%%.") .. "$", "%1") if count == 0 then - link, count = filename:gsub(target.filename("([%w%-_]+)", "shared"):gsub("%.", "%%.") .. "$", "%1") + link, count = filename:gsub(target.filename("([%%w%%-_]+)", "shared"):gsub("%.", "%%.") .. "$", "%1") end -- ok? diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_package.lua b/xmake/core/sandbox/modules/import/lib/detect/find_package.lua index 03976addb..cfd683217 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_package.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_package.lua @@ -141,11 +141,16 @@ function sandbox_lib_detect_find_package._find_from_modules(name, opt) end end --- find package from pkg-config +-- find package from pkg-config/brew function sandbox_lib_detect_find_package._find_from_pkg_config(name, opt) return import("lib.detect.pkg_config").find(name, opt) end +-- find package from vcpkg +function sandbox_lib_detect_find_package._find_from_vcpkg(name, opt) + return import("lib.detect.vcpkg").find(name, opt) +end + -- find package from system directories function sandbox_lib_detect_find_package._find_from_systemdirs(name, opt) @@ -251,6 +256,9 @@ function sandbox_lib_detect_find_package._find(name, opt) -- find package from modules table.insert(findscripts, sandbox_lib_detect_find_package._find_from_modules) + -- find package from vcpkg (support multi-platforms/architectures) + table.insert(findscripts, sandbox_lib_detect_find_package._find_from_vcpkg) + -- find package from the current host platform if opt.plat == os.host() and opt.arch == os.arch() then table.insert(findscripts, sandbox_lib_detect_find_package._find_from_pkg_config) |
