Skip to content

Commit

Permalink
[configure] Add option to disable device-related parts of the build. (#…
Browse files Browse the repository at this point in the history
…67)

And use it when building on jenkins.
  • Loading branch information
rolfbjarne committed May 19, 2016
1 parent 323c7f4 commit d48d7c2
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ INCLUDE_IOS=1
INCLUDE_MAC=1
INCLUDE_WATCH=1
INCLUDE_TVOS=1
INCLUDE_DEVICE=1

-include $(TOP)/Make.config.local
-include $(TOP)/configure.inc
Expand Down
18 changes: 18 additions & 0 deletions builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1344,10 +1344,12 @@ ARM_ARCH_CONFIGURE_FLAGS=--host=arm-apple-darwin10 --disable-boehm
ARM64_ARCH_CONFIGURE_FLAGS=--host=aarch64-apple-darwin10 --disable-boehm

ifdef INCLUDE_IOS
ifdef INCLUDE_DEVICE
ifndef DEVICE_RUNTIMES
DEVICE_RUNTIMES="armv7 armv7s arm64 "
endif
endif
endif

# Note the spaces in findstring arguments, this is needed to distinguish between armv7 and armv7s for example
ifneq ($(findstring armv7 , $(DEVICE_RUNTIMES) ),)
Expand All @@ -1362,6 +1364,7 @@ ifneq ($(findstring arm64 , $(DEVICE_RUNTIMES) ),)
$(eval $(call PlatformBuildTemplate,arm64,target64,,$(ARM64_ARCH_CONFIGURE_FLAGS),,7.0))
endif

ifdef INCLUDE_DEVICE
iphoneos:: setup-iphoneos build-iphoneos install-iphoneos
device:: iphoneos
clean-device: clean-iphoneos
Expand All @@ -1370,6 +1373,7 @@ clean-device: clean-iphoneos
ifdef INCLUDE_IOS
install-local:: install-iphoneos
endif
endif

IPHONEOS_TARGETS = \
$(IOS_DESTDIR)$(IPHONEOS_PREFIX)/lib/libmonosgen-2.0.a \
Expand Down Expand Up @@ -1499,6 +1503,7 @@ WATCHOS_ENVIRONMENT = \
DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) \

ifdef INCLUDE_WATCH
ifdef INCLUDE_DEVICE
setup:: setup-targetwatch
build:: build-targetwatch
clean-local:: clean-targetwatch
Expand All @@ -1509,6 +1514,7 @@ watchos:: targetwatch

.PHONY: targetwatch
endif
endif

setup-targetwatch: .stamp-configure-targetwatch

Expand Down Expand Up @@ -1675,6 +1681,7 @@ TVOS_ENVIRONMENT = \
DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) \

ifdef INCLUDE_TVOS
ifdef INCLUDE_DEVICE
setup:: setup-targettv
build:: build-targettv
clean-local:: clean-targettv
Expand All @@ -1685,6 +1692,7 @@ tvos:: targettv

.PHONY: targettv
endif
endif

setup-targettv: .stamp-configure-targettv

Expand Down Expand Up @@ -1762,6 +1770,7 @@ install-tvos: $(TVOS_TARGETS)
#
# we need to compile the cross build against llvm so we need to configure/build that first
#
ifdef INCLUDE_DEVICE
cross:: build-llvm
cross64:: build-llvm64

Expand All @@ -1770,6 +1779,7 @@ clean-local:: clean-llvm clean-llvm64

setup-llvm: .stamp-configure-llvm
setup-llvm64: .stamp-configure-llvm64
endif

LLVM_BASE_CONFIGURE_FLAGS=--enable-libcpp --enable-optimized --enable-assertions=no --disable-jit --disable-docs --disable-doxygen
LLVM_CXXFLAGS=$(CCACHE_CXXFLAGS)
Expand Down Expand Up @@ -1900,6 +1910,7 @@ CROSS_CONFIGURE_ENVIRONMENT = \
CXX="$(MAC_CXX)" \

ifdef INCLUDE_IOS
ifdef INCLUDE_DEVICE
cross:: build-cross install-cross

.PHONY: setup-cross build-cross install-cross
Expand All @@ -1909,6 +1920,7 @@ build:: build-cross
install-local:: install-cross
clean-local:: clean-cross
endif
endif

setup-cross: .stamp-configure-cross

Expand Down Expand Up @@ -1961,11 +1973,13 @@ CROSS64_CONFIGURE_ENVIRONMENT = \
cross64:: build-cross64 install-cross64

ifdef INCLUDE_IOS
ifdef INCLUDE_DEVICE
setup:: setup-cross64
build:: build-cross64
install-local:: install-cross64
clean-local:: clean-cross64
endif
endif

setup-cross64: .stamp-configure-cross64

Expand Down Expand Up @@ -2024,6 +2038,7 @@ WATCH_CONFIGURE_ENVIRONMENT = \
CXX="$(MAC_CXX)" \

ifdef INCLUDE_WATCH
ifdef INCLUDE_DEVICE
cross:: build-cross-watch install-cross-watch

.PHONY: setup-cross-watch build-cross-watch install-cross-watch
Expand All @@ -2033,6 +2048,7 @@ build:: build-cross-watch
install-local:: install-cross-watch
clean-local:: clean-cross-watch
endif
endif

.PHONY: cross-watch
cross-watch: build-cross-watch install-cross-watch
Expand Down Expand Up @@ -2087,6 +2103,7 @@ TV_CROSS_CONFIGURE_ENVIRONMENT = \


ifdef INCLUDE_TVOS
ifdef INCLUDE_DEVICE
cross:: build-crosstv install-crosstv

.PHONY: setup-crosstv build-crosstv install-crosstv
Expand All @@ -2096,6 +2113,7 @@ build:: build-crosstv
install-local:: install-crosstv
clean-local:: clean-crosstv
endif
endif

setup-crosstv: .stamp-configure-crosstv

Expand Down
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Usage: configure [options]
The main reasons for disabling either part is to have faster
builds and disable the non-relevant tests.
--disable-ios-device Disables all device-related parts from the iOS build.
This can be used to speed up the build.
--disable-strip: If executables should be stripped or not.
Disable to make it easier to debug executables using lldb.
Expand Down Expand Up @@ -41,6 +44,10 @@ while test x$1 != x; do
echo "Mac Build disabled (partially)"
shift
;;
--disable-ios-device)
echo "INCLUDE_DEVICE=" >> $CONFIGURED_FILE
shift
;;
--disable-ios)
echo "INCLUDE_IOS=" >> $CONFIGURED_FILE
echo "INCLUDE_WATCH=" >> $CONFIGURED_FILE
Expand Down
2 changes: 1 addition & 1 deletion jenkins.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e

./configure
./configure --disable-ios-device
time make world
25 changes: 24 additions & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,38 @@ RUNTIME_$(2)_TARGETS_DIRS += \

RUNTIME_$(2)_TARGETS += \
$$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/$$(file)) \
$$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/$$(file)) \
$(foreach file,$(SHIPPED_HEADERS),$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/$(file)) \

ifdef INCLUDE_DEVICE
RUNTIME_$(2)_TARGETS += \
$$(foreach file,$$($(2)_LIBRARIES),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/$$(file)) \
$(foreach file,$(SHIPPED_HEADERS),$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/$(file)) \

endif

$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/%.a: .libs/$(1)/%.a | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib
$(Q) install -m 0644 $$< $$@

ifdef INCLUDE_DEVICE
$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/%.a: .libs/$(1)/%.a | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib
$(Q) install -m 0644 $$< $$@
endif

$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib/%.dylib: .libs/$(1)/%.dylib | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/lib
$(Q) install -m 0644 $$< $$@

ifdef INCLUDE_DEVICE
$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib/%.dylib: .libs/$(1)/%.dylib | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/lib
$(Q) install -m 0644 $$< $$@
endif

$(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/%.h: %.h | $(IOS_DESTDIR)$$(XAMARIN_$(4)SIMULATOR_SDK)/usr/include/xamarin
$(Q) install -m 0644 $$< $$@

ifdef INCLUDE_DEVICE
$(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/%.h: %.h | $(IOS_DESTDIR)$$(XAMARIN_$(5)OS_SDK)/usr/include/xamarin
$(Q) install -m 0644 $$< $$@
endif

$$(RUNTIME_$(2)_TARGETS_DIRS):
$(Q) mkdir -p $$@
Expand All @@ -138,15 +149,27 @@ endef
# 4: simulator variable name used in some places
# 5: device variable name used in some places
ifdef INCLUDE_IOS
ifdef INCLUDE_DEVICE
$(eval $(call PlatformTemplate,ios,IOS,armv7 armv7s arm64 x86 x86_64,IOS,IPHONE))
else
$(eval $(call PlatformTemplate,ios,IOS, x86 x86_64,IOS,IPHONE))
endif
endif

ifdef INCLUDE_WATCH
ifdef INCLUDE_DEVICE
$(eval $(call PlatformTemplate,watchos,WATCHOS,armv7k x86,WATCH,WATCH))
else
$(eval $(call PlatformTemplate,watchos,WATCHOS, x86,WATCH,WATCH))
endif
endif

ifdef INCLUDE_TVOS
ifdef INCLUDE_DEVICE
$(eval $(call PlatformTemplate,tvos,TVOS,arm64 x86_64,TV,TV))
else
$(eval $(call PlatformTemplate,tvos,TVOS, x86_64,TV,TV))
endif
endif

#
Expand Down

0 comments on commit d48d7c2

Please sign in to comment.