diff options
| author | ruki <[email protected]> | 2022-02-07 22:49:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-02-07 10:57:31 +0800 |
| commit | 35e9deaaa950521472ba54bf2fffb5f20e32011d (patch) | |
| tree | 880257c9c93ca27defbb299906462a7fe2ac70c0 /xmake/modules/package/tools/gn.lua | |
| parent | e5739724f0bade30cb6c4afafd772c0ddea152d2 (diff) | |
improve gn tools
Diffstat (limited to 'xmake/modules/package/tools/gn.lua')
| -rw-r--r-- | xmake/modules/package/tools/gn.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/gn.lua b/xmake/modules/package/tools/gn.lua index 362373c2c..65a50a05d 100644 --- a/xmake/modules/package/tools/gn.lua +++ b/xmake/modules/package/tools/gn.lua @@ -36,6 +36,25 @@ end -- get configs function _get_configs(package, configs, opt) + configs = configs or {} + if not package:is_plat("windows") then + configs.cc = package:build_getenv("cc") + configs.cxx = package:build_getenv("cxx") + else + configs.extra_cflags = {(package:config("vs_runtime"):startswith("MT") and "/MT" or "/MD")} + end + if package:is_plat("macosx") then + configs.extra_ldflags = {"-lstdc++"} + local xcode = toolchain.load("xcode", {plat = package:plat(), arch = package:arch()}) + configs.xcode_sysroot = xcode:config("xcode_sysroot") + 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" + end return configs end |
