OSDN Git Service

Change the mtc Makefile to check $SDKROOT value instead
authorJason Molenda <jmolenda@apple.com>
Wed, 11 Dec 2019 02:46:24 +0000 (18:46 -0800)
committerJason Molenda <jmolenda@apple.com>
Wed, 11 Dec 2019 02:48:40 +0000 (18:48 -0800)
of depending on it being set in the environment.  Fred's change
from October assumed that SDKROOT was set in the environment
so that 'xcrun --show-sdk-path' would print the path.  If it
was passed in as a Makefile variable, it wouldn't be set in
the environment and xcrun --show-sdk-path would always show the
macOS SDK path.  When running the lldb testsuite against an ios
device via lit, this seems to be the case.

lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile

index 1b231a5..f27f57a 100644 (file)
@@ -1,9 +1,14 @@
 OBJC_SOURCES := main.m
-ifeq ($(findstring MacOSX.platform,$(shell xcrun --show-sdk-path)),MacOSX.platform)
 UI_FRAMEWORK = AppKit
-else
-UI_FRAMEWORK = UIKit
+
+ifneq ("$(SDKROOT)", "")
+       ifeq (,$(findstring macOS,$(SDKROOT)))
+               ifeq (,$(findstring MacOS,$(SDKROOT)))
+                       UI_FRAMEWORK = UIKit
+               endif
+       endif
 endif
+
 LD_EXTRAS = -lobjc -framework Foundation -framework $(UI_FRAMEWORK)
 
 include Makefile.rules