Skip to content
Commit 728ff1da authored by Rebecca Cran's avatar Rebecca Cran Committed by mergify[bot]
Browse files

BaseTools: Allow users to build with clang using CC=clang CXX=clang++

In https://bugzilla.tianocore.org/show_bug.cgi?id=2842

 clang support was
added by having users specify "make CXX=llvm" when building BaseTools.

The Makefile then sees that and sets CC=$(CLANG_BIN)clang and
CXX=$(CLANG_BIN)clang++. That requires that the executables 'clang' and
'clang++' exist and for example aren't named 'clang-17' and
'clang++-17'. Also, it's an unusual way of specifying the compiler,
since many users will expect to be able to override CC and CXX on the
make command line.

Rework the BaseTools Makefiles removing the 'BUILD_' prefix (BUILD_CC
and BUILD_CXX) and using the standard name 'LDFLAGS' instead of
'LFLAGS'. This allows clang to be used by running
'make -C BaseTools CC=clang CXX=clang++'.

Signed-off-by: default avatarRebecca Cran <rebecca@quicinc.com>
Reviewed-by: default avatarLiming Gao <gaoliming@byosoft.com.cn>
parent 206168e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment