[Lldb-commits] [lldb] r355843 - Makefile.rules: Upstream SDKROOT handling code for Darwin.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 11 10:24:10 PDT 2019


Author: adrian
Date: Mon Mar 11 10:24:10 2019
New Revision: 355843

URL: http://llvm.org/viewvc/llvm-project?rev=355843&view=rev
Log:
Makefile.rules: Upstream SDKROOT handling code for Darwin.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=355843&r1=355842&r2=355843&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Mon Mar 11 10:24:10 2019
@@ -167,6 +167,17 @@ ifeq "$(CC)" "cc"
 endif
 
 #----------------------------------------------------------------------
+# Handle SDKROOT on Darwin
+#----------------------------------------------------------------------
+
+ifeq "$(OS)" "Darwin"
+    ifeq "$(SDKROOT)" ""
+        # We haven't otherwise set the SDKROOT, so set it now to macosx
+        SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path)
+    endif
+endif
+
+#----------------------------------------------------------------------
 # ARCHFLAG is the flag used to tell the compiler which architecture
 # to compile for. The default is the flag that clang accepts.
 #----------------------------------------------------------------------
@@ -248,6 +259,13 @@ endif
 DEBUG_INFO_FLAG ?= -g
 
 CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 -fno-builtin
+
+ifeq "$(OS)" "Darwin"
+	ifneq "$(SDKROOT)" ""
+		CFLAGS += -isysroot "$(SDKROOT)"
+	endif
+endif
+
 ifeq "$(OS)" "Darwin"
 	CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include
 else




More information about the lldb-commits mailing list