Also build with static_library version of libchromiumcontent

This commit is contained in:
Cheng Zhao 2015-04-02 23:03:23 +08:00
parent ca161e29ce
commit dab9e9be67
5 changed files with 102 additions and 69 deletions

View file

@ -14,7 +14,7 @@ def main():
os.chdir(SOURCE_ROOT)
update_external_binaries()
update_gyp()
return update_gyp()
def update_external_binaries():
@ -23,27 +23,37 @@ def update_external_binaries():
def update_gyp():
gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py')
python = sys.executable
arch = DIST_ARCH
target_arch = DIST_ARCH
if sys.platform == 'darwin':
# Only have 64bit build on OS X.
arch = 'x64'
target_arch = 'x64'
elif sys.platform in ['cygwin', 'win32']:
# Only have 32bit build on Windows.
arch = 'ia32'
if sys.platform == 'cygwin':
# Force using win32 python on cygwin.
python = os.path.join('vendor', 'python_26', 'python.exe')
target_arch = 'ia32'
ret = subprocess.call([python, gyp,
'-f', 'ninja', '--depth', '.', 'atom.gyp',
'-Icommon.gypi',
'-Dlinux_clang=0', # Disable brightray's clang setting
'-Dtarget_arch={0}'.format(arch),
'-Dlibrary=static_library'])
if ret != 0:
sys.exit(ret)
# Since gyp doesn't support specify link_settings for each configuration,
# we are not able to link to different libraries in "Debug" and "Release"
# configurations.
# In order to work around this, we decided to generate the configuration
# for twice, one is to generate "Debug" config, the other one to generate
# the "Release" config. And the settings are controlled by the variable
# "libchromiumcontent_component" which is defined before running gyp.
return (run_gyp(target_arch, 0) or run_gyp(target_arch, 1))
def run_gyp(target_arch, component):
python = sys.executable
if sys.platform == 'cygwin':
# Force using win32 python on cygwin.
python = os.path.join('vendor', 'python_26', 'python.exe')
gyp = os.path.join('vendor', 'brightray', 'vendor', 'gyp', 'gyp_main.py')
return subprocess.call([python, gyp,
'-f', 'ninja', '--depth', '.', 'atom.gyp',
'-Icommon.gypi',
'-Dlibchromiumcontent_component={0}'.format(component),
'-Dlinux_clang=0', # FIXME remove me.
'-Dtarget_arch={0}'.format(target_arch),
'-Dlibrary=static_library'])
if __name__ == '__main__':