소스 검색

Fix for make-linux: detect whether CC/CXX were explicitly overridden, and if not then use the gcc/clang selection logic. Otherwise ?= breaks this.

Adam Ierymenko 10 년 전
부모
커밋
a493fc23f4
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      make-linux.mk

+ 8 - 2
make-linux.mk

@@ -18,8 +18,14 @@
 #
 
 # Automagically pick clang or gcc, with preference for clang
-CC?=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi)
-CXX?=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
+# This is only done if we have not overridden these with an environment or CLI variable
+ifeq ($(origin CC),default)
+	CC=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi)
+endif
+ifeq ($(origin CXX),default)
+	CXX=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
+endif
+
 INCLUDES=
 DEFS=
 LDLIBS?=