Skip to content

Commit

Permalink
Android用.aファイルに、nativeAPIの一部が含まれていないため、AARファイルとは別にビルドし直す
Browse files Browse the repository at this point in the history
Signed-off-by: Zenichi Amano <[email protected]>
  • Loading branch information
crow-misia committed Aug 8, 2020
1 parent f418917 commit fe748e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ $(1).fetch: depot_tools
$(SCRIPTS_DIR)/fetch_webrtc.sh $(WEBRTC_DIR) $(DEPOT_TOOLS_DIR) $(WEBRTC_COMMIT) $(CONFIG_DIR)/$(1)

.PHONY: $(1).build
$(1).build: prepare $(1).fetch sync
$(1).build: prepare $(CCACHE) $(1).fetch sync
make $(SUB_DIR_OPTS) -C $(1) build

.PHONY: $(1).build-nofetch
$(1).build-nofetch: sync
$(1).build-nofetch: $(CCACHE) sync
make $(SUB_DIR_OPTS) -C $(1) build

.PHONY: $(1).copy
Expand Down
17 changes: 14 additions & 3 deletions build/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,23 @@ build: patch
--build-dir $(BUILD_DIR) \
--output $(BUILD_DIR)/libwebrtc.aar \
--arch armeabi-v7a arm64-v8a \
--extra-gn-args 'is_debug=false rtc_use_h264=false rtc_include_tests=false is_component_build=false is_clang=true rtc_build_json=true use_custom_libcxx=false use_rtti=true'
--extra-gn-args '$(CC_WRAPPER) is_debug=false rtc_use_h264=false rtc_include_tests=false is_clang=true rtc_build_json=true use_custom_libcxx=false use_rtti=true'

cd $(BUILD_DIR)/armeabi-v7a/obj && \
ln -sf $(DEPOT_TOOLS_DIR)/vpython $(DEPOT_TOOLS_DIR)/python
cd $(SRC_DIR) && \
vpython $(DEPOT_TOOLS_DIR)/gn.py gen $(BUILD_DIR)/armeabi-v7a-static --args='$(CC_WRAPPER) target_os="android" target_cpu="arm" arm_version=7 is_debug=false rtc_build_examples=false rtc_use_h264=false rtc_include_tests=false is_clang=true rtc_build_json=true use_custom_libcxx=false use_rtti=true' && \
ninja -C $(BUILD_DIR)/armeabi-v7a-static && \
ninja -C $(BUILD_DIR)/armeabi-v7a-static native_api

cd $(BUILD_DIR)/armeabi-v7a-static/obj && \
$(SRC_DIR)/third_party/llvm-build/Release+Asserts/bin/llvm-ar -rc $(BUILD_DIR)/armeabi-v7a/libwebrtc.a `find . -name '*.o'`

cd $(BUILD_DIR)/arm64-v8a/obj && \
cd $(SRC_DIR) && \
vpython $(DEPOT_TOOLS_DIR)/gn.py gen $(BUILD_DIR)/arm64-v8a-static --args='$(CC_WRAPPER) target_os="android" target_cpu="arm64" is_debug=false rtc_build_examples=false rtc_use_h264=false rtc_include_tests=false is_clang=true rtc_build_json=true use_custom_libcxx=false use_rtti=true' && \
ninja -C $(BUILD_DIR)/arm64-v8a-static && \
ninja -C $(BUILD_DIR)/arm64-v8a-static native_api

cd $(BUILD_DIR)/arm64-v8a-static/obj && \
$(SRC_DIR)/third_party/llvm-build/Release+Asserts/bin/llvm-ar -rc $(BUILD_DIR)/arm64-v8a/libwebrtc.a `find . -name '*.o'`

cd $(BUILD_DIR) && \
Expand Down
2 changes: 1 addition & 1 deletion build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ common-package: copy

.PHONY: generate-licenses
generate-licenses:
python2 $(SRC_DIR)/tools_webrtc/libs/generate_licenses.py --target :webrtc $(BUILD_DIR) $(BUILD_DIR)
vpython $(SRC_DIR)/tools_webrtc/libs/generate_licenses.py --target :webrtc $(BUILD_DIR) $(BUILD_DIR)

.PHONY: common-copy
common-copy: generate-licenses
Expand Down

0 comments on commit fe748e4

Please sign in to comment.