Skip to content

Commit

Permalink
gyp: improvements for android generator
Browse files Browse the repository at this point in the history
When generating Android.mk files for HOST binaries, we need to specify
the LOCAL_CXX_STL to use when linking.
Also, set the variable GYP_HOST_MULTILIB to 'first'. This is used as
LOCAL_MULTILIB, and since we don't provide flags for both types of
builds (32-bit and 64-bit), the build system will try to build both and
fail.
More details about LOCAL_MULTILIB can be found here:
https://source.android.com/source/64-bit-builds.html

Signed-off-by: Robert Chiras <[email protected]>
PR-URL: #935
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
robertchiras authored and bnoordhuis committed May 19, 2016
1 parent 0880827 commit 7f1c1b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gyp/pylib/gyp/generator/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, part_of_all,
self.WriteLn('LOCAL_PRELINK_MODULE := false')
self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier)
elif self.type == 'executable':
self.WriteLn('LOCAL_CXX_STL := libc++_static')
# Executables are for build and test purposes only, so they're installed
# to a directory that doesn't get included in the system image.
self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)')
Expand Down Expand Up @@ -1080,7 +1081,7 @@ def CalculateMakefilePath(build_file, base_name):
root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration)
root_makefile.write('GYP_VAR_PREFIX ?=\n')
root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n')
root_makefile.write('GYP_HOST_MULTILIB ?=\n')
root_makefile.write('GYP_HOST_MULTILIB ?= first\n')

# Write out the sorted list of includes.
root_makefile.write('\n')
Expand Down

0 comments on commit 7f1c1b9

Please sign in to comment.