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

"Compile Active File" does not work with an empty define #1493

Closed
dslijepcevic opened this issue Oct 19, 2020 · 2 comments
Closed

"Compile Active File" does not work with an empty define #1493

dslijepcevic opened this issue Oct 19, 2020 · 2 comments
Assignees
Labels
bug a bug in the product duplicate a duplicate of an already present issue Feature: build
Milestone

Comments

@dslijepcevic
Copy link

Brief Issue Summary

It looks like "Compile Active File" incorrectly parses empty defines from compile_commands.json. Instead of passing -DMY_DEFINE= to the compiler, it passes an empty argument.

CMakeLists.txt:

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(test C)
add_executable(test test.c)
target_compile_definitions(test PUBLIC MY_DEFINE=)

test.c:

int main()
{
    return 0;
}

build/compile_commands.json:

[
{
  "directory": "/proj/test/build",
  "command": "/usr/bin/cc -DMY_DEFINE=\"\"  -g   -o CMakeFiles/test.dir/test.c.o   -c /proj/test/test.c",
  "file": "/proj/test/test.c"
}
]

"Compile Active File" output:

/usr/bin/cc "" -g -o CMakeFiles/test.dir/test.c.o -c /proj/test/test.c
/proj/test/build$ /usr/bin/cc "" -g -o CMakeFiles/test.dir/test.c.o -c /proj/test/test.c
cc: error: : No such file or directory
@andreeis andreeis added this to the On Deck milestone Oct 19, 2020
@andreeis andreeis added bug a bug in the product Feature: build labels Oct 19, 2020
@andreeis
Copy link
Contributor

Thank you for reporting this issue. We'll let you know if we need more info to investigate it.

@elahehrashedi
Copy link
Contributor

"Compile Active File" does not work with any string define.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product duplicate a duplicate of an already present issue Feature: build
Projects
None yet
Development

No branches or pull requests

3 participants