diff options
| author | ruki <[email protected]> | 2022-02-17 23:32:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-02-17 23:32:17 +0800 |
| commit | 4f95a3d8fbcbadabcecf71fb902c90c75693e433 (patch) | |
| tree | 5e14c6766d503d9ee44ff66ea46f7ef06782bc6c | |
| parent | a488013ba3fc29f9d368a10926640f58bfae7678 (diff) | |
fix pdb with spaces
| -rw-r--r-- | .github/workflows/archlinux.yml | 8 | ||||
| -rw-r--r-- | tests/projects/c++/modules/hello with spaces/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 9 |
3 files changed, 11 insertions, 7 deletions
diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml index 19dceb588..035433687 100644 --- a/.github/workflows/archlinux.yml +++ b/.github/workflows/archlinux.yml @@ -16,14 +16,14 @@ jobs: group: ${{ github.head_ref }}-Archlinux cancel-in-progress: true steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Prepare build tools run: | pacman -Sy --noconfirm --needed git base-devel perl make unzip + - uses: actions/checkout@v2 + with: + submodules: true + - name: prepare local xmake run: | cp -rf . ../xmake-source diff --git a/tests/projects/c++/modules/hello with spaces/xmake.lua b/tests/projects/c++/modules/hello with spaces/xmake.lua index 6a69ce121..4f46b699d 100644 --- a/tests/projects/c++/modules/hello with spaces/xmake.lua +++ b/tests/projects/c++/modules/hello with spaces/xmake.lua @@ -1,3 +1,4 @@ +add_rules("mode.release", "mode.debug") set_languages("c++20") target("A hello") set_kind("binary") diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index b76061cd7..b499542e3 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -112,11 +112,14 @@ function nf_symbols(self, levels, target) end -- check and add symbol output file - local pdbflags = "-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile))) + -- + -- @note we need use `{}` to wrap it to avoid expand it + -- https://github.com/xmake-io/xmake/issues/2061#issuecomment-1042590085 + local pdbflags = {"-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile)))} if self:has_flags({"-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-FS -Fd" }) then - pdbflags = {"-FS", pdbflags} + table.insert(pdbflags, 1, "-FS") end - table.join2(flags, pdbflags) + table.insert(flags, pdbflags) end end return flags |
