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

cxx fails, when CXX or CXXFLAGS are used #7

Open
winspool opened this issue Mar 12, 2024 · 1 comment
Open

cxx fails, when CXX or CXXFLAGS are used #7

winspool opened this issue Mar 12, 2024 · 1 comment

Comments

@winspool
Copy link
Contributor

the cxx tool fails to handle CXX or CXXFLAGS environment variables correctly,
even for a hello.cpp

Examples:

CXX="g++  -DHELLO_FROM_CXX" cxx
CXX="g++"  CXXFLAGS="-DHELLO_FROM_CXXFLAGS" cxx

Instead of building the example, scons prints the scons commandline help.


When avoiding a "-D" in CXXFLAGS and using a "-I" instead (with a script for CXX),
the failure is different:

Example with "scriptname":

CXX="scriptname"  CXXFLAGS=" -I/$HOME/dummy_include_dir "  cxx 

scriptname -o hello.o -c -std=c++20 -O2 -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -Wpedantic -Wno-parentheses -Wfatal-errors -Wvla -Wignored-qualifiers hello.cpp
sh: 1: scriptname: not found
*** [hello.o] Error 127

Using export makes no difference:

export CXX="scriptname"
export CXXFLAGS=" -I/$HOME/dummy_include_dir "
cxx

scriptname -o hello.o -c -std=c++20 -O2 -pipe -fPIC -fno-plt -fstack-protector-strong -Wall -Wshadow -Wpedantic -Wno-parentheses -Wfatal-errors -Wvla -Wignored-qualifiers hello.cpp
sh: 1: scriptname: not found
*** [hello.o] Error 127
@xyproto xyproto self-assigned this Mar 12, 2024
@xyproto
Copy link
Owner

xyproto commented Mar 12, 2024

Ah, yes. This isn't really supported. I want to support this in cxx2 which will be a scons-less rewrite.

Until then, I'll either update the documentation to say this isn't supported or add support for it.

Thanks for reporting.

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