Skip to content

Commit

Permalink
Merge pull request #1517 from dsanghan:master
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 346592524
  • Loading branch information
Copybara-Service committed Dec 9, 2020
2 parents 30570c0 + 91eeab3 commit 989ff59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ J2OBJC_ARCHS = $(subst _, ,$(ENV_J2OBJC_ARCHS))
else
# 32bit iPhone archs are no longer built by default. To build a release
# with them, define J2OBJC_ARCHS with "iphone" and "simulator" included.
J2OBJC_ARCHS = macosx iphone64 iphone64e watchv7k watch64 watchsimulator \
J2OBJC_ARCHS = macosx macosx64 iphone64 iphone64e watchv7k watch64 watchsimulator \
simulator64 maccatalyst
ifeq ($(TVOS_AVAILABLE), YES)
J2OBJC_ARCHS += appletvos appletvsimulator
Expand Down
18 changes: 12 additions & 6 deletions make/fat_lib_macros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ FAT_LIB_TVSIMULATOR_SDK_DIR := $(shell bash $(J2OBJC_ROOT)/scripts/sysroot_path.

FAT_LIB_MACOSX_FLAGS = $(FAT_LIB_OSX_FLAGS) -DJ2OBJC_BUILD_ARCH=x86_64 -mmacosx-version-min=10.7 \
-isysroot $(FAT_LIB_MACOSX_SDK_DIR)
FAT_LIB_MACOSX64_FLAGS = $(FAT_LIB_OSX_FLAGS) -arch arm64 -DJ2OBJC_BUILD_ARCH=arm64 \
--target=arm64-apple-macos11 \
-isysroot $(FAT_LIB_MACOSX_SDK_DIR)

FAT_LIB_IPHONE_FLAGS = -arch armv7 -DJ2OBJC_BUILD_ARCH=armv7 -miphoneos-version-min=5.0 \
-isysroot $(FAT_LIB_IPHONE_SDK_DIR)
Expand Down Expand Up @@ -76,6 +79,7 @@ fat_lib_filtered_libtool = set -o pipefail \

arch_flags = $(strip \
$(patsubst macosx,$(FAT_LIB_MACOSX_FLAGS),\
$(patsubst macosx64,$(FAT_LIB_MACOSX64_FLAGS),\
$(patsubst iphone,$(FAT_LIB_IPHONE_FLAGS),\
$(patsubst iphone64,$(FAT_LIB_IPHONE64_FLAGS),\
$(patsubst iphone64e,$(FAT_LIB_IPHONE64E_FLAGS),\
Expand All @@ -86,7 +90,7 @@ arch_flags = $(strip \
$(patsubst simulator64,$(FAT_LIB_SIMULATOR64_FLAGS),\
$(patsubst appletvos,$(FAT_LIB_TV_FLAGS),\
$(patsubst appletvsimulator,$(FAT_LIB_TVSIMULATOR_FLAGS),\
$(patsubst maccatalyst,$(FAT_LIB_MAC_CATALYST_FLAGS),$(1))))))))))))))
$(patsubst maccatalyst,$(FAT_LIB_MAC_CATALYST_FLAGS),$(1)))))))))))))))

fat_lib_dependencies:
@:
Expand Down Expand Up @@ -181,9 +185,9 @@ endef
# Args:
# 1. Library name.
define mac_lib_rule
$(ARCH_BUILD_MACOSX_DIR)/lib$(1).a: $(BUILD_DIR)/objs-macosx/lib$(1).a
$(ARCH_BUILD_MACOSX_DIR)/lib$(1).a: $(2)
@mkdir -p $$(@D)
install -m 0644 $$< $$@
$$(LIPO) -create $$^ -output $$@
endef

# Generate the rule for the maccatalyst library
Expand Down Expand Up @@ -239,8 +243,8 @@ emit_arch_specific_compile_rules = $(foreach arch,$(XCODE_ARCHS),\
else
# Targets specific to a command-line build

FAT_LIB_IOS_ARCHS = $(filter-out macosx maccatalyst appletv% watch%,$(J2OBJC_ARCHS))
FAT_LIB_MAC_ARCH = $(filter macosx,$(J2OBJC_ARCHS))
FAT_LIB_IOS_ARCHS = $(filter-out macos% maccatalyst appletv% watch%,$(J2OBJC_ARCHS))
FAT_LIB_MAC_ARCHS = $(filter macos%,$(J2OBJC_ARCHS))
FAT_LIB_WATCH_ARCHS = $(filter watch%,$(J2OBJC_ARCHS))
FAT_LIB_TV_ARCHS = $(filter appletv%,$(J2OBJC_ARCHS))
FAT_LIB_MAC_CATALYST_ARCH = $(filter maccatalyst,$(J2OBJC_ARCHS))
Expand All @@ -253,7 +257,9 @@ emit_library_rules = $(foreach arch,$(J2OBJC_ARCHS),\
$(if $(FAT_LIB_WATCH_ARCHS),\
$(eval $(call watch_lib_rule,$(1),$(FAT_LIB_WATCH_ARCHS:%=$(BUILD_DIR)/objs-%/lib$(1).a))) \
$(ARCH_BUILD_WATCH_DIR)/lib$(1).a,) \
$(if $(FAT_LIB_MAC_ARCH),$(eval $(call mac_lib_rule,$(1))) $(ARCH_BUILD_MACOSX_DIR)/lib$(1).a,) \
$(if $(FAT_LIB_MAC_ARCHS),\
$(eval $(call mac_lib_rule,$(1),$(FAT_LIB_MAC_ARCHS:%=$(BUILD_DIR)/objs-%/lib$(1).a))) \
$(ARCH_BUILD_MACOSX_DIR)/lib$(1).a,) \
$(if $(FAT_LIB_MAC_CATALYST_ARCH),\
$(eval $(call mac_catalyst_lib_rule,$(1))) $(ARCH_BUILD_MAC_CATALYST_DIR)/lib$(1).a,) \
$(if $(FAT_LIB_TV_ARCHS),\
Expand Down

0 comments on commit 989ff59

Please sign in to comment.