diff options
-rw-r--r-- | pylib/gyp/generator/make.py | 6 | ||||
-rw-r--r-- | 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', + ], + }, ], } |