diff options
| author | ruki <[email protected]> | 2024-08-30 22:49:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-30 22:49:47 +0800 |
| commit | 456eedcebb5adac9063d9417f68a47ebe0cddb49 (patch) | |
| tree | 2578e3f3262e46c854497c2e861bd8d29d831c67 /xmake/modules/package/tools | |
| parent | d1b64e63ff0e39badc4bd03b65033149af66c5f8 (diff) | |
fix map runtime flags
Diffstat (limited to 'xmake/modules/package/tools')
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 7d5550390..938d96dad 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -881,15 +881,11 @@ function _get_envs_for_runtime_flags(package, configs, opt) local envs = {} local runtimes = package:runtimes() if runtimes then - local fake_target = {is_shared = function(_) return false end, - sourcekinds = function(_) return "cc" end} - envs[format("CMAKE_C_FLAGS_%s", buildtype)] = _map_compflags(fake_target, "c", "runtime", runtimes) - fake_target.sourcekinds = function(_) return "cxx" end - envs[format("CMAKE_CXX_FLAGS_%s", buildtype)] = _map_compflags(fake_target, "cxx", "runtime", runtimes) - envs[format("CMAKE_EXE_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(fake_target, "binary", {"cxx"}, "runtime", runtimes) - envs[format("CMAKE_STATIC_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(fake_target, "static", {"cxx"}, "runtime", runtimes) - fake_target.is_shared = function(_) return true end - envs[format("CMAKE_SHARED_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(fake_target, "shared", {"cxx"}, "runtime", runtimes) + envs[format("CMAKE_C_FLAGS_%s", buildtype)] = _map_compflags(package, "c", "runtime", runtimes) + envs[format("CMAKE_CXX_FLAGS_%s", buildtype)] = _map_compflags(package, "cxx", "runtime", runtimes) + envs[format("CMAKE_EXE_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(package, "binary", {"cxx"}, "runtime", runtimes) + envs[format("CMAKE_STATIC_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(package, "static", {"cxx"}, "runtime", runtimes) + envs[format("CMAKE_SHARED_LINKER_FLAGS_%s", buildtype)] = _map_linkflags(package, "shared", {"cxx"}, "runtime", runtimes) end return envs end |
