From 299eb63862f16469aa6548d0d947f930fa756de7 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Wed, 14 Mar 2012 16:04:11 +0000 Subject: mac make: Don't put host shared libraries into the product directory. With the components build, but host and target create a libbase.dylib. With the old code, both would end up directly in out/Release, creating conflicting build rules for out/Release/libbase.dylib. Instead, let the host version go into out/Release/obj.host/base/libbase.dylib BUG=chromium:90078 Review URL: https://chromiumcodereview.appspot.com/9700021 git-svn-id: http://gyp.googlecode.com/svn/trunk@1245 78cadc50-ecff-11dd-a971-7dbc132099af --- pylib/gyp/generator/make.py | 6 ++++-- test/toolsets/toolsets.gyp | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index e93cb033..d2729c52 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -1555,7 +1555,8 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD file_desc = 'executable' install_path = self._InstallableTargetInstallPath() installable_deps = [self.output] - if self.flavor == 'mac' and not 'product_dir' in spec: + if (self.flavor == 'mac' and not 'product_dir' in spec and + self.toolset == 'target'): # On mac, products are created in install_path immediately. assert install_path == self.output, '%s != %s' % ( install_path, self.output) @@ -1849,7 +1850,8 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD """Returns the location of the final output for an installable target.""" # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files # rely on this. Emulate this behavior for mac. - if self.type == 'shared_library' and self.flavor != 'mac': + if (self.type == 'shared_library' and + (self.flavor != 'mac' or self.toolset != 'target')): # Install all shared libs into a common directory (per toolset) for # convenient access with LD_LIBRARY_PATH. return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) diff --git a/test/toolsets/toolsets.gyp b/test/toolsets/toolsets.gyp index e41b928d..286edf2f 100644 --- a/test/toolsets/toolsets.gyp +++ b/test/toolsets/toolsets.gyp @@ -34,5 +34,15 @@ 'main.cc', ], }, + # This tests that build systems can handle a shared library being build for + # both host and target. + { + 'target_name': 'janus', + 'type': 'shared_library', + 'toolsets': ['target', 'host'], + 'sources': [ + 'toolsets.cc', + ], + }, ], } -- cgit v1.2.3