summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@quicinc.com>2023-02-16 08:40:46 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-05 15:44:48 +0000
commit206168e83f0901cbc1815ef5df4ac6598ad9721b (patch)
treec4a1e91eab861f861c2f3aeef10649bd4db9c80d /BaseTools/Source/Python
parentcdd79996c217805a5bd67bb0c0e4ca05474ef92e (diff)
downloadedk2-206168e83f0901cbc1815ef5df4ac6598ad9721b.tar.gz
edk2-206168e83f0901cbc1815ef5df4ac6598ad9721b.tar.bz2
edk2-206168e83f0901cbc1815ef5df4ac6598ad9721b.zip
BaseTools: Allow users to specify compiler to use with make CC= CXX=
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: Rebecca Cran <rebecca@quicinc.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 73c6ee4006..8fd949dc50 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -89,7 +89,7 @@ PcdMakefileHeader = '''
'''
WindowsCFLAGS = 'CFLAGS = $(CFLAGS) /wd4200 /wd4034 /wd4101 '
-LinuxCFLAGS = 'BUILD_CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable '
+LinuxCFLAGS = 'CFLAGS += -Wno-pointer-to-int-cast -Wno-unused-variable '
PcdMakefileEnd = '''
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.common
!INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app