Index: packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile +++ packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../../make OBJC_SOURCES := main.m -CFLAGS += -fmodules -gmodules -g +CFLAGS += -gmodules $(MANDATORY_MODULE_BUILD_CFLAGS) include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile +++ packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile @@ -4,5 +4,5 @@ include $(LEVEL)/Makefile.rules -CFLAGS += -fmodules -I$(PWD) +CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(PWD) LDFLAGS += -framework Foundation Index: packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile +++ packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile @@ -6,4 +6,4 @@ include $(LEVEL)/Makefile.rules -CFLAGS += -fmodules -I$(PWD) +CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(PWD) Index: packages/Python/lldbsuite/test/make/Makefile.rules =================================================================== --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -237,13 +237,15 @@ CFLAGS += -gsplit-dwarf endif +CLANG_MODULE_CACHE_DIR := module-cache + +MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR) + ifeq "$(MAKE_GMODULES)" "YES" - CFLAGS += -fmodules -gmodules + CFLAGS += -gmodules $(MANDATORY_MODULE_BUILD_CFLAGS) endif -CXXFLAGS += -std=c++11 -# FIXME: C++ modules aren't supported on all platforms. -CXXFLAGS += $(subst -fmodules,, $(CFLAGS)) +CXXFLAGS += -std=c++11 $(CFLAGS) LD = $(CC) LDFLAGS ?= $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) @@ -636,7 +638,7 @@ dsym: $(DSYM) all: $(EXE) $(DSYM) clean:: - $(RM) $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) + $(RM) -rf $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) $(CLANG_MODULE_CACHE_DIR) ifneq "$(DYLIB_NAME)" "" $(RM) -r $(DYLIB_FILENAME).dSYM $(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_DWOS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug