diff options
| author | ruki <[email protected]> | 2023-10-09 23:50:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-10-09 23:50:23 +0800 |
| commit | 7a7b1aa4b45d455b9594f7768ff4092fbd0cc2f0 (patch) | |
| tree | 551c315e93a7a35fd8912155a087928b9ff077ca /xmake/modules | |
| parent | 09998f98aa1fc8d5d2c3ce9762400c309b51b972 (diff) | |
improve trybuild/cmake
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/trybuild/cmake.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/private/action/trybuild/cmake.lua b/xmake/modules/private/action/trybuild/cmake.lua index 4e9729108..b600f3ef6 100644 --- a/xmake/modules/private/action/trybuild/cmake.lua +++ b/xmake/modules/private/action/trybuild/cmake.lua @@ -102,7 +102,12 @@ function _is_cross_compilation() end -- get configs for windows -function _get_configs_for_windows(configs) +function _get_configs_for_windows(configs, opt) + opt = opt or {} + local cmake_generator = opt.cmake_generator + if cmake_generator and not cmake_generator:find("Visual Studio", 1, true) then + return + end table.insert(configs, "-A") if is_arch("x86", "i386") then table.insert(configs, "Win32") @@ -377,7 +382,7 @@ function _get_configs(opt) _get_configs_for_install(configs, opt) _get_configs_for_generator(configs, opt) if is_plat("windows") then - _get_configs_for_windows(configs) + _get_configs_for_windows(configs, opt) elseif is_plat("android") then _get_configs_for_android(configs) elseif is_plat("iphoneos", "watchos") or |
