Skip to content

Commit

Permalink
Use clang to build for ReactAndroid
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Oct 31, 2018
1 parent e90319e commit 68024f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
11 changes: 0 additions & 11 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy
include "folly-${FOLLY_VERSION}/folly/**/*", 'Android.mk'
eachFile {fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/")}
includeEmptyDirs = false

// Patch for folly build break on gcc 4.9 and could be removed after build by clang
filesMatching('**/container/detail/F14Policy.h') {
filter(ReplaceTokens, tokens: [
'ObjectHolder(Args&&... args) : value_{std::forward<Args>(args)...} {}': 'ObjectHolder(Args&&... args) : value_({std::forward<Args>(args)...}) {}',
'ObjectHolder(Args&&... args) : T{std::forward<Args>(args)...} {}': 'ObjectHolder(Args&&... args) : T({std::forward<Args>(args)...}) {}',
],
beginToken: '',
endToken: '')
}

into "$thirdPartyNdkDir/folly"
}

Expand Down
6 changes: 2 additions & 4 deletions ReactAndroid/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
# etc.) are defined inside build.gradle.
NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSEP)$(REACT_COMMON_DIR)$(HOST_DIRSEP)$(APP_MK_DIR)first-party$(HOST_DIRSEP)$(REACT_SRC_DIR)

APP_STL := gnustl_shared
APP_STL := c++_shared

# Make sure every shared lib includes a .note.gnu.build-id header
APP_CFLAGS := -Wall -Werror
APP_CFLAGS := -Wall -Werror -Wno-unused-lambda-capture
APP_CPPFLAGS := -std=c++1y
APP_LDFLAGS := -Wl,--build-id

NDK_TOOLCHAIN_VERSION := 4.9
1 change: 1 addition & 0 deletions ReactAndroid/src/main/jni/third-party/folly/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ FOLLY_FLAGS := \
-DFOLLY_NO_CONFIG=1 \
-DFOLLY_HAVE_CLOCK_GETTIME=1 \
-DFOLLY_HAVE_MEMRCHR=1 \
-DFOLLY_USE_LIBCPP=1 \

# If APP_PLATFORM in Application.mk targets android-23 above, please comment this line.
# NDK uses GNU style stderror_r() after API 23.
Expand Down

0 comments on commit 68024f4

Please sign in to comment.