Support Mac-Android Cross-Compilation

- Rename Android sampleApp target to SampleAppAndroid to avoid name collision
- Detect skia_os on Darwin to differentiate between xcode and make builds
Review URL: https://codereview.appspot.com/6303044

git-svn-id: http://skia.googlecode.com/svn/trunk@4168 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
borenet@google.com 2012-06-05 17:57:48 +00:00
parent b83f7978d7
commit b52cf3dd95
2 changed files with 9 additions and 6 deletions

View File

@ -86,12 +86,15 @@ out/Makefile:
# For the Mac, we create a convenience symlink to the generated binary.
.PHONY: $(ALL_TARGETS)
$(ALL_TARGETS):: gyp_if_needed
ifneq (,$(findstring Linux, $(uname)))
ifneq (,$(findstring skia_os=android, $(GYP_DEFINES)))
$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
endif
ifneq (,$(findstring Darwin, $(uname)))
else ifneq (,$(findstring Linux, $(uname)))
$(MAKE) -C out $@ BUILDTYPE=$(BUILDTYPE)
else ifneq (,$(findstring Darwin, $(uname)))
rm -f out/$(BUILDTYPE) || if test -d out/$(BUILDTYPE); then echo "run 'make clean' or otherwise delete out/$(BUILDTYPE)"; exit 1; fi
xcodebuild -project out/gyp/$@.xcodeproj -configuration $(BUILDTYPE)
ln -s $(CWD)/xcodebuild/$(BUILDTYPE) out/$(BUILDTYPE)
endif
else
echo "unknown platform $(uname)"
exit 1
endif

View File

@ -252,7 +252,7 @@
'experimental.gyp:experimental',
],
'dependencies': [
'android_system.gyp:sampleApp',
'android_system.gyp:SampleAppAndroid',
],
}],
],