Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quotes stripped in defines containing spaces #1084

Closed
cmeerw opened this issue Nov 28, 2020 · 4 comments
Closed

quotes stripped in defines containing spaces #1084

cmeerw opened this issue Nov 28, 2020 · 4 comments

Comments

@cmeerw
Copy link
Contributor

cmeerw commented Nov 28, 2020

Note: If you use the fuzzy expressions such as 'can't use/no effect/problem/error', but don't give any relevant auxiliary information according to the template below, this issue will be not replied.

Describe the bug

xmake.lua

add_defines("TEST=\"Hello world\"")
target("test")
    set_kind("binary")
    add_files("test.cpp")

Expected behavior

Command line should contain "-DTEST=\"Hello world\"" (or something similar)

Error output

actual command line is:

/usr/bin/gcc -c -m64 "-DTEST=Hello world" -o build/.objs/test/linux/x86_64/release/test.cpp.o test.cpp

Related Environment

Please provide compiling and running environment information:

  • xmake version: v2.3.9+202011250027
  • os: Linux (Ubuntu 20.10)
  • target platform: Linux (Ubuntu 20.10)

Additional context

test.cpp should compile cleanly with above xmake.lua file:

#include <iostream>

int main()
{
  std::cout << TEST << std::endl;
}

Note that

add_defines("TEST=\"Hello_world\"")

seems to work fine.

@waruqi
Copy link
Member

waruqi commented Nov 29, 2020

I have fixed it on dev branch

@waruqi waruqi added the bug label Nov 29, 2020
@waruqi waruqi added this to the v2.5.1 milestone Nov 29, 2020
@waruqi
Copy link
Member

waruqi commented Nov 29, 2020

I found that the previous changes will affect many other problems, I revert it now.

I will fix it later, you may need to wait for some time.

@waruqi
Copy link
Member

waruqi commented Jan 11, 2021

Sorry for keeping you waiting so long, about this issue, I have fixed it on the argv branch. You can download it from https://github.com/xmake-io/xmake/actions/runs/477576244 and update to the argv branch version and try it. If it works, I will merge it in these days.

related patch: #1188

@waruqi
Copy link
Member

waruqi commented Jan 11, 2021

I have merged into dev branch

@waruqi waruqi closed this as completed Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants