diff options
| author | ruki <[email protected]> | 2022-02-07 23:17:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-02-07 23:17:56 +0800 |
| commit | 3fe6979242797797d5a1f8405ddc195ba60c318a (patch) | |
| tree | f43039848a922c41216daf294bd3bd30a023c2a9 | |
| parent | e224edb4709a9c67925edfaf909beb5dea6ee22d (diff) | |
improve gn tools
| -rw-r--r-- | xmake/modules/package/tools/gn.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/gn.lua b/xmake/modules/package/tools/gn.lua index 65a50a05d..d6037d5e1 100644 --- a/xmake/modules/package/tools/gn.lua +++ b/xmake/modules/package/tools/gn.lua @@ -48,12 +48,29 @@ function _get_configs(package, configs, opt) local xcode = toolchain.load("xcode", {plat = package:plat(), arch = package:arch()}) configs.xcode_sysroot = xcode:config("xcode_sysroot") end + if package:is_plat("linux") then + configs.target_os = "linux" + elseif package:is_plat("macosx") then + configs.target_os = "mac" + elseif package:is_plat("windows") then + configs.target_os = "win" + elseif package:is_plat("iphoneos") then + configs.target_os = "ios" + elseif package:is_plat("android") then + configs.target_os = "android" + end if package:is_arch("x86", "i386") then configs.target_cpu = "x86" elseif package:is_arch("x64", "x86_64") then configs.target_cpu = "x64" elseif package:is_arch("arm64", "arm64-v8a") then configs.target_cpu = "arm64" + elseif package:is_arch("arm.*") then + configs.target_cpu = "arm" + end + configs.is_debug = package:is_debug() + if not package:is_debug() then + configs.symbol_level = 0 end return configs end |
