diff options
| author | Jérôme Leclercq <[email protected]> | 2024-05-07 22:03:41 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-07 22:03:41 +0200 |
| commit | 0a7ca31247014d90a8794537b05e8fa564251192 (patch) | |
| tree | 6a422153a68eaafc87325008c9d352f6de29b66f /xmake/modules/package/tools/cmake.lua | |
| parent | 103e21f46b0b286ac274e315c8a18b83651561a0 (diff) | |
Fix booleans in env config
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 0bd963751..36f0b704a 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -786,11 +786,21 @@ function _get_envs_for_default_flags(package, configs, opt) local envs = {} local default_flags = _get_default_flags(package, configs, buildtype, opt) if default_flags then - envs[format("CMAKE_CXX_FLAGS_%s", buildtype)] = (not opt.cxxflags and not opt.cxflags) and default_flags.cxxflags - envs[format("CMAKE_C_FLAGS_%s", buildtype)] = (not opt.cflags and not opt.cxflags) and default_flags.cflags - envs[format("CMAKE_EXE_LINKER_FLAGS_%s", buildtype)] = not opt.ldflags and default_flags.ldflags - envs[format("CMAKE_STATIC_LINKER_FLAGS_%s", buildtype)] = not opt.arflags and default_flags.arflags - envs[format("CMAKE_SHARED_LINKER_FLAGS_%s", buildtype)] = not opt.shflags and default_flags.shflags + if not opt.cxxflags and not opt.cxflags then + envs[format("CMAKE_CXX_FLAGS_%s", buildtype)] = default_flags.cxxflags + end + if not opt.cflags and not opt.cxflags then + envs[format("CMAKE_C_FLAGS_%s", buildtype)] = default_flags.cflags + end + if not opt.ldflags then + envs[format("CMAKE_EXE_LINKER_FLAGS_%s", buildtype)] = default_flags.ldflags + end + if not opt.arflags then + envs[format("CMAKE_STATIC_LINKER_FLAGS_%s", buildtype)] = default_flags.arflags + end + if not opt.shflags then + envs[format("CMAKE_SHARED_LINKER_FLAGS_%s", buildtype)] = default_flags.shflags + end end return envs end |
