From c11a598d7cac6f450277261d39ce887727a433b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 31 Jul 2014 10:12:58 +0200 Subject: [PATCH] build: handle platforms without multiprocessing.synchronize --- gyp_uv.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gyp_uv.py b/gyp_uv.py index f0c59d07..f5afc6da 100755 --- a/gyp_uv.py +++ b/gyp_uv.py @@ -6,6 +6,13 @@ import os import subprocess import sys +try: + import multiprocessing.synchronize + gyp_parallel_support = True +except ImportError: + gyp_parallel_support = False + + CC = os.environ.get('CC', 'cc') script_dir = os.path.dirname(__file__) uv_root = os.path.normpath(script_dir) @@ -94,6 +101,11 @@ if __name__ == '__main__': if not any(a.startswith('-Dcomponent=') for a in args): args.append('-Dcomponent=static_library') + # Some platforms (OpenBSD for example) don't have multiprocessing.synchronize + # so gyp must be run with --no-parallel + if not gyp_parallel_support: + args.append('--no-parallel') + gyp_args = list(args) print gyp_args run_gyp(gyp_args)