cc-rs
cc-rs copied to clipboard
cc interprets quotes in CFLAGS/CXXFLAGS differently from CMake
For CMake, CXXFLAGS="'-DRETURN1=return 1;'" generates a macro that returns 1, in cc, this is interpreted as an argument '-DRETURN1=return and an argument 1;'. This seems undesirable.
Would a patch fixing this be accepted?
For CMake, CXXFLAGS="'-DRETURN1=return 1;'" generates a macro that returns 1
Have you verified that CMake also behaves like this on Windows? AFAIK (but I may be wrong) on windows shells this doesn't work because single quotes don't have the same meaning as on Linux/macOS. An Alternative solution would be that cc reads an environment variable like ENCODED_CXXFLAGS, which would be split by Ox1f same as CARGO_ENCODED_RUSTFLAGS.