diff options
| author | ruki <[email protected]> | 2023-10-19 20:31:56 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-19 20:31:56 -0500 |
| commit | 0ca9061fee10061eae6151002abb76ce9eb8c3ed (patch) | |
| tree | 8e2771763d9ba47052fd8f0978e7b12d98ec74eb /xmake/plugins | |
| parent | ff24cac604e403bd930898da743e27bd9eca1d48 (diff) | |
| parent | 21a665d3aa5c67c97a7b28e177c16d24193e7ebf (diff) | |
Merge pull request #4302 from xqyjlj/cmake-dev
🐞 fix(project/cmake/cmakelists): fix when generate map file
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 9d66cba48..cdcd226eb 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -159,7 +159,7 @@ function _translate_flag(flag, outputdir) flag = "-fmodule-mapper=" .. _get_relative_unix_path_to_cmake(flag:sub(17), outputdir) elseif flag:match("(.+)=(.+)") then local k, v = flag:match("(.+)=(.+)") - if v and v:endswith(".ifc") then -- e.g. hello=xxx/hello.ifc + if v and (v:endswith(".ifc") or v:endswith(".map")) then -- e.g. hello=xxx/hello.ifc flag = k .. "=" .. _get_relative_unix_path_to_cmake(v, outputdir) end end @@ -845,13 +845,13 @@ function _add_target_link_directories(cmakelists, target, outputdir) end -- add target link options -function _add_target_link_options(cmakelists, target) +function _add_target_link_options(cmakelists, target, outputdir) local ldflags = _get_configs_from_target(target, "ldflags") local shflags = _get_configs_from_target(target, "shflags") if #ldflags > 0 or #shflags > 0 then local flags = {} for _, flag in ipairs(table.unique(table.join(ldflags, shflags))) do - table.insert(flags, flag) + table.insert(flags, _translate_flag(flag, outputdir)) end if #flags > 0 then local cmake_minver = _get_cmake_minver() @@ -1046,7 +1046,7 @@ function _add_target(cmakelists, target, outputdir) _add_target_link_directories(cmakelists, target, outputdir) -- add target link options - _add_target_link_options(cmakelists, target) + _add_target_link_options(cmakelists, target, outputdir) -- add target sources _add_target_sources(cmakelists, target, outputdir) |
