diff options
author | David 'Digit' Turner <digit@google.com> | 2010-01-07 14:08:39 -0800 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2010-01-07 14:08:39 -0800 |
commit | c973b058ebe38bb585a9a6026e39519db1f91c33 (patch) | |
tree | 9cd50c9eb7168b2525b20ab162038040ff21c884 /android | |
parent | 39fd8497a66aa9f78a18c8684181128361612c6f (diff) | |
download | external_qemu-c973b058ebe38bb585a9a6026e39519db1f91c33.zip external_qemu-c973b058ebe38bb585a9a6026e39519db1f91c33.tar.gz external_qemu-c973b058ebe38bb585a9a6026e39519db1f91c33.tar.bz2 |
Add support to the emulator's standalone build system for C++ sources.
Diffstat (limited to 'android')
-rw-r--r-- | android/build/binary.make | 5 | ||||
-rw-r--r-- | android/build/clear_vars.make | 1 | ||||
-rw-r--r-- | android/build/definitions.make | 20 |
3 files changed, 26 insertions, 0 deletions
diff --git a/android/build/binary.make b/android/build/binary.make index 5052dc1..e22a96d 100644 --- a/android/build/binary.make +++ b/android/build/binary.make @@ -21,12 +21,17 @@ LOCAL_OBJS_DIR := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE)) LOCAL_OBJECTS := LOCAL_CC ?= $(CC) LOCAL_C_SOURCES := $(filter %.c,$(LOCAL_SRC_FILES) $(LOCAL_GENERATED_SOURCES)) +LOCAL_CXX_SOURCES := $(filter %$(LOCAL_CPP_EXTENSION),$(LOCAL_SRC_FILES) $(LOCAL_GENERATED_SOURCES)) LOCAL_OBJC_SOURCES := $(filter %.m,$(LOCAL_SRC_FILES) $(LOCAL_GENERATED_SOURCES)) $(foreach src,$(LOCAL_C_SOURCES), \ $(eval $(call compile-c-source,$(src))) \ ) +$(foreach src,$(LOCAL_CXX_SOURCES), \ + $(eval $(call compile-cxx-source,$(src))) \ +) + $(foreach src,$(LOCAL_OBJC_SOURCES), \ $(eval $(call compile-objc-source,$(src))) \ ) diff --git a/android/build/clear_vars.make b/android/build/clear_vars.make index a9289b0..f84ecb4 100644 --- a/android/build/clear_vars.make +++ b/android/build/clear_vars.make @@ -28,3 +28,4 @@ LOCAL_STATIC_LIBRARIES := LOCAL_BUILT_MODULE := LOCAL_PREBUILT_OBJ_FILES := +LOCAL_CPP_EXTENSION := .cpp diff --git a/android/build/definitions.make b/android/build/definitions.make index 54d1a8a..e190cdd 100644 --- a/android/build/definitions.make +++ b/android/build/definitions.make @@ -68,6 +68,26 @@ $$(OBJ): $$(SRC_PATH)/$$(SRC) $(hide) $$(BUILD_SYSTEM)/mkdeps.sh $$(PRIVATE_OBJ) $$(PRIVATE_OBJ).d.tmp $$(PRIVATE_OBJ).d endef +# Compile a C++ source file +# +define compile-cxx-source +SRC:=$(1) +OBJ:=$$(LOCAL_OBJS_DIR)/$$(SRC:%$(LOCAL_CPP_EXTENSION)=%.o) +LOCAL_OBJECTS += $$(OBJ) +DEPENDENCY_DIRS += $$(dir $$(OBJ)) +$$(OBJ): PRIVATE_CFLAGS := $$(CFLAGS) $$(LOCAL_CFLAGS) -I$$(LOCAL_PATH) -I$$(OBJS_DIR) +$$(OBJ): PRIVATE_CXX := $$(LOCAL_CC) +$$(OBJ): PRIVATE_OBJ := $$(OBJ) +$$(OBJ): PRIVATE_MODULE := $$(LOCAL_MODULE) +$$(OBJ): PRIVATE_SRC := $$(SRC_PATH)/$$(SRC) +$$(OBJ): PRIVATE_SRC0 := $$(SRC) +$$(OBJ): $$(SRC_PATH)/$$(SRC) + @mkdir -p $$(dir $$(PRIVATE_OBJ)) + @echo "Compile: $$(PRIVATE_MODULE) <= $$(PRIVATE_SRC0)" + $(hide) $$(PRIVATE_CXX) $$(PRIVATE_CFLAGS) -c -o $$(PRIVATE_OBJ) -MMD -MP -MF $$(PRIVATE_OBJ).d.tmp $$(PRIVATE_SRC) + $(hide) $$(BUILD_SYSTEM)/mkdeps.sh $$(PRIVATE_OBJ) $$(PRIVATE_OBJ).d.tmp $$(PRIVATE_OBJ).d +endef + # Compile an Objective-C source file # define compile-objc-source |