aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/make/Makefile.rules
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/make/Makefile.rules')
-rw-r--r--packages/Python/lldbsuite/test/make/Makefile.rules81
1 files changed, 44 insertions, 37 deletions
diff --git a/packages/Python/lldbsuite/test/make/Makefile.rules b/packages/Python/lldbsuite/test/make/Makefile.rules
index 5abbc85e649b..a7b94ef57380 100644
--- a/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -32,10 +32,26 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
#----------------------------------------------------------------------
+# If OS is not defined, use 'uname -s' to determine the OS name.
+#
+# uname on Windows gives "windows32", but most environments standardize
+# on "Windows_NT", so we'll make it consistent here. When running
+# tests from Visual Studio, the environment variable isn't inherited
+# all the way down to the process spawned for make.
+#----------------------------------------------------------------------
+HOST_OS = $(shell uname -s)
+ifeq "$(HOST_OS)" "windows32"
+ HOST_OS = Windows_NT
+endif
+ifeq "$(OS)" ""
+ OS = $(HOST_OS)
+endif
+
+#----------------------------------------------------------------------
# If TRIPLE is not defined try to set the ARCH, CC, CFLAGS, and more
# from the triple alone
#----------------------------------------------------------------------
-TRIPLE_CFLAGS :=
+ARCH_CFLAGS :=
ifneq "$(TRIPLE)" ""
triple_space = $(subst -, ,$(TRIPLE))
ARCH =$(word 1, $(triple_space))
@@ -52,33 +68,20 @@ ifneq "$(TRIPLE)" ""
ifeq "$(TRIPLE_VERSION)" ""
TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/')
endif
- TRIPLE_CFLAGS :=-mios-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
+ ARCH_CFLAGS :=-mios-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
else
SDKROOT = $(shell xcrun --sdk iphonesimulator --show-sdk-path)
ifeq "$(TRIPLE_VERSION)" ""
TRIPLE_VERSION =$(shell echo $(notdir $(SDKROOT)) | sed -e 's/.*\([0-9]\.[0-9]\).*/\1/')
endif
- TRIPLE_CFLAGS :=-mios-simulator-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
+ ARCH_CFLAGS :=-mios-simulator-version-min=$(TRIPLE_VERSION) -isysroot "$(SDKROOT)"
endif
endif
endif
endif
endif
-
-#----------------------------------------------------------------------
-# If OS is not defined, use 'uname -s' to determine the OS name.
-#
-# uname on Windows gives "windows32", but most environments standardize
-# on "Windows_NT", so we'll make it consistent here. When running
-# tests from Visual Studio, the environment variable isn't inherited
-# all the way down to the process spawned for make.
-#----------------------------------------------------------------------
-HOST_OS = $(shell uname -s)
-ifeq "$(HOST_OS)" "windows32"
- HOST_OS = Windows_NT
-endif
-ifeq "$(OS)" ""
- OS = $(HOST_OS)
+ifeq "$(OS)" "Android"
+ include $(THIS_FILE_DIR)/Android.rules
endif
#----------------------------------------------------------------------
@@ -199,13 +202,13 @@ else
CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) -I$(LLDB_BASE_DIR)include
endif
-CFLAGS += -include $(THIS_FILE_DIR)test_common.h $(TRIPLE_CFLAGS)
+CFLAGS += -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR) $(ARCH_CFLAGS)
# Use this one if you want to build one part of the result without debug information:
ifeq "$(OS)" "Darwin"
- CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(TRIPLE_CFLAGS)
+ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(ARCH_CFLAGS)
else
- CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(TRIPLE_CFLAGS)
+ CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) $(ARCH_CFLAGS)
endif
ifeq "$(MAKE_DWO)" "YES"
@@ -221,7 +224,7 @@ CXXFLAGS += -std=c++11
CXXFLAGS += $(subst -fmodules,, $(CFLAGS))
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
-LDFLAGS += $(LD_EXTRAS)
+LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
ifeq (,$(filter $(OS), Windows_NT Android))
ifneq (,$(filter YES,$(ENABLE_THREADS)))
LDFLAGS += -pthread
@@ -297,10 +300,12 @@ ifeq "$(OS)" "Windows_NT"
# Clang for Windows doesn't support C++ Exceptions
CXXFLAGS += -fno-exceptions
CXXFLAGS += -D_HAS_EXCEPTIONS=0
- ifeq "$(VisualStudioVersion)" "14.0"
- CXXFLAGS += -fms-compatibility-version=19.0
- override CXXFLAGS := $(subst -std=c++11,-std=c++14,$(CXXFLAGS))
- endif
+
+ # MSVC 2015 or higher is required, which depends on c++14, so
+ # append these values unconditionally.
+ CXXFLAGS += -fms-compatibility-version=19.0
+ override CXXFLAGS := $(subst -std=c++11,-std=c++14,$(CXXFLAGS))
+
# The MSVC linker doesn't understand long section names
# generated by the clang compiler.
LDFLAGS += -fuse-ld=lld
@@ -319,19 +324,21 @@ ifeq (1,$(USE_LIBSTDCPP))
endif
ifeq (1,$(USE_LIBCPP))
- # Clang requires an extra flag: -stdlib=libstdc++
- ifneq (,$(findstring clang,$(CC)))
- ifeq "$(OS)" "Linux"
- # This is the default install location on Ubuntu 14.04
- ifneq ($(wildcard /usr/include/c++/v1/.),)
- CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP
- LDFLAGS += -stdlib=libc++
- CXXFLAGS += -I/usr/include/c++/v1
- endif
- else
- CXXFLAGS += -stdlib=libc++ -DLLDB_USING_LIBCPP
+ CXXFLAGS += -DLLDB_USING_LIBCPP
+ ifeq "$(OS)" "Linux"
+ ifneq (,$(findstring clang,$(CC)))
+ CXXFLAGS += -stdlib=libc++
LDFLAGS += -stdlib=libc++
+ else
+ CXXFLAGS += -isystem /usr/include/c++/v1
+ LDFLAGS += -lc++
endif
+ else ifeq "$(OS)" "Android"
+ # Nothing to do, this is already handled in
+ # Android.rules.
+ else
+ CXXFLAGS += -stdlib=libc++
+ LDFLAGS += -stdlib=libc++
endif
endif