From 046e37f25cd64f30e0fea7ac12bb59e89e390d31 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 12 Feb 2021 14:28:53 -0800 Subject: Fix ninja tool rules for macos/ar for static libs to skip response files for now. Also fix build_libraries to have proper shlib suffix --- SCons/Tool/ninjaCommon/__init__.py | 7 +++++++ test/ninja/build_libraries.py | 5 ++++- testing/framework/TestCmd.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/SCons/Tool/ninjaCommon/__init__.py b/SCons/Tool/ninjaCommon/__init__.py index 090d3d8..d46d692 100644 --- a/SCons/Tool/ninjaCommon/__init__.py +++ b/SCons/Tool/ninjaCommon/__init__.py @@ -637,6 +637,13 @@ class NinjaState: }, } + if env['PLATFORM'] == 'darwin' and env['AR'] == 'ar': + self.rules["AR"] = { + "command": "rm -f $out && $env$AR $rspc", + "description": "Archiving $out", + "pool": "local_pool", + } + self.pools = { "local_pool": self.env.GetOption("num_jobs"), "install_pool": self.env.GetOption("num_jobs") / 2, diff --git a/test/ninja/build_libraries.py b/test/ninja/build_libraries.py index a1c3282..b3c7b54 100644 --- a/test/ninja/build_libraries.py +++ b/test/ninja/build_libraries.py @@ -26,7 +26,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import TestSCons -from TestCmd import IS_WINDOWS +from TestCmd import IS_WINDOWS, IS_MACOS test = TestSCons.TestSCons() @@ -64,6 +64,9 @@ else: lib_prefix = 'lib' win32 = '' +if IS_MACOS: + lib_suffix = '.dylib' + test.write('SConstruct', """ env = Environment() env.Tool('ninja') diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 333901c..903bee6 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -314,6 +314,7 @@ from subprocess import PIPE, STDOUT IS_WINDOWS = sys.platform == 'win32' +IS_MACOS = sys.platform == 'darwin' IS_64_BIT = sys.maxsize > 2**32 IS_PYPY = hasattr(sys, 'pypy_translation_info') -- cgit v0.12