diff options
| author | ruki <[email protected]> | 2019-11-08 22:36:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-11-08 09:38:34 +0800 |
| commit | fb6fb82e0878a46a194370c1c3f3f6a68e4862b0 (patch) | |
| tree | ff28e0f4b42169074952bc538c52496c55c39c86 | |
| parent | 22d816464bf727fc83412136ecf8efe6df7cea84 (diff) | |
add os.api_level for android/conan
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/modules/package/manager/conan/find_package.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/package/manager/conan/install_package.lua | 13 |
3 files changed, 15 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b524b5082..706a408c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Improve `xmake create` action * [#589](https://github.com/xmake-io/xmake/issues/589): Improve the default build jobs number to optimize build speed * [#598](https://github.com/xmake-io/xmake/issues/598): Improve find_package to support .tbd libraries on macOS +* [#615](https://github.com/xmake-io/xmake/issues/615): Support to install and use other archs and ios conan packages ### Bugs fixed @@ -661,6 +662,7 @@ * 改进`xmake create`创建模板工程 * [#589](https://github.com/xmake-io/xmake/issues/589): 改进默认的构建任务数,充分利用cpu core来提速整体编译速度 * [#598](https://github.com/xmake-io/xmake/issues/598): 改进`find_package`支持在macOS上对.tbd系统库文件的查找 +* [#615](https://github.com/xmake-io/xmake/issues/615): 支持安装和使用其他arch和ios的conan包 ### Bugs修复 diff --git a/xmake/modules/package/manager/conan/find_package.lua b/xmake/modules/package/manager/conan/find_package.lua index 3dc30dc29..0f8526d9c 100644 --- a/xmake/modules/package/manager/conan/find_package.lua +++ b/xmake/modules/package/manager/conan/find_package.lua @@ -40,9 +40,10 @@ function _conan_get_arch(opt) i386 = "x86", x86 = "x86", armv7 = "armv7", - armv7s = "armv7s", - arm64 = "armv8", - ["arm64-v8a"] = "armv8", + ["armv7-a"] = "armv7", -- for android + armv7s = "armv7s", -- for iphoneos + arm64 = "armv8", -- for iphoneos + ["arm64-v8a"] = "armv8", -- for android mips = "mips", mips64 = "mips64"} return archs[opt.arch] diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua index b463ce0ef..146729d39 100644 --- a/xmake/modules/package/manager/conan/install_package.lua +++ b/xmake/modules/package/manager/conan/install_package.lua @@ -41,6 +41,7 @@ function _conan_generate_conanfile(name, opt) local imports = table.wrap(opt.imports) local build_requires = table.wrap(opt.build_requires) + -- @see https://docs.conan.io/en/latest/systems_cross_building/cross_building.html -- generate it io.writefile("conanfile.txt", ([[ [generators] @@ -156,9 +157,10 @@ function main(name, opt) i386 = "x86", x86 = "x86", armv7 = "armv7", - armv7s = "armv7s", + ["armv7-a"] = "armv7", -- for android + armv7s = "armv7s", -- for iphoneos arm64 = "armv8", -- for iphoneos - ["arm64-v8a"] = "armv8", + ["arm64-v8a"] = "armv8", -- for android mips = "mips", mips64 = "mips64"} table.insert(argv, "-s") @@ -190,7 +192,6 @@ function main(name, opt) table.insert(argv, "compiler.runtime=" .. opt.vs_runtime) end elseif opt.plat == "iphoneos" then - -- TODO local target_minver = config.get("target_minver") if target_minver and tonumber(target_minver) > 10 and (arch == "armv7" or arch == "armv7s" or arch == "x86") then target_minver = "10" -- iOS 10 is the maximum deployment target for 32-bit targets @@ -200,7 +201,11 @@ function main(name, opt) table.insert(argv, "os.version=" .. target_minver) end elseif opt.plat == "android" then - -- TODO + local ndk_sdkver = config.get("ndk_sdkver") + if ndk_sdkver then + table.insert(argv, "-s") + table.insert(argv, "os.api_level=" .. ndk_sdkver) + end end -- set custom settings |
