diff options
| author | ruki <[email protected]> | 2019-03-15 23:29:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-03-15 14:59:01 +0800 |
| commit | 3484d7d8458276c5bb5fd63de0b7aa733acff43c (patch) | |
| tree | 0d67976feb66e968c3aa2bb4afd3e2c40489a64a | |
| parent | 62540eacb93339ebbdc36156834f4fc19aa19e64 (diff) | |
fix get configs for cmake
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 4f8cde55f..005525d14 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -29,12 +29,14 @@ import("lib.detect.find_file") -- get configs function _get_configs(package, configs) local configs = configs or {} - local vs_runtime = package:config("vs_runtime") - if vs_runtime then - table.insert(configs, '-DCMAKE_CXX_FLAGS_DEBUG="/' .. vs_runtime .. 'd"') - table.insert(configs, '-DCMAKE_CXX_FLAGS_RELEASE="/' .. vs_runtime .. '"') - table.insert(configs, '-DCMAKE_C_FLAGS_DEBUG="/' .. vs_runtime .. 'd"') - table.insert(configs, '-DCMAKE_C_FLAGS_RELEASE="/' .. vs_runtime .. '"') + if package:plat() == "windows" then + local vs_runtime = package:config("vs_runtime") + if vs_runtime then + table.insert(configs, '-DCMAKE_CXX_FLAGS_DEBUG="/' .. vs_runtime .. 'd"') + table.insert(configs, '-DCMAKE_CXX_FLAGS_RELEASE="/' .. vs_runtime .. '"') + table.insert(configs, '-DCMAKE_C_FLAGS_DEBUG="/' .. vs_runtime .. 'd"') + table.insert(configs, '-DCMAKE_C_FLAGS_RELEASE="/' .. vs_runtime .. '"') + end end return configs end |
