Skip to content

cxx fails, when CXX or CXXFLAGS are used #7

@winspool

Description

@winspool

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions