Use abusolute path when linking to external libraries. Fixes #22.
The ninja generator of gyp behaves strangely on the 'libraries' field of link settings, for example, specifying path to an external library works well on both xcodebuild and msvc generators, but the ninja generator would link to the wrong path (it can neither translate relative path correctly, nor convert the command line parameter to the '-lxxx' form). The only way to make all generators work on all platforms is to use abusolute paths for external libraries.
This commit is contained in:
parent
3d00cded27
commit
5e807cffc8
2 changed files with 16 additions and 4 deletions
|
@ -2,6 +2,9 @@
|
|||
'includes': [
|
||||
'brightray.gypi',
|
||||
],
|
||||
'variables': {
|
||||
'brightray_source_root': '<!(python tools/brightray_source_root.py)',
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'brightray',
|
||||
|
@ -70,7 +73,7 @@
|
|||
['OS=="mac"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'libchromiumcontent.dylib',
|
||||
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/libchromiumcontent.dylib',
|
||||
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
|
||||
],
|
||||
},
|
||||
|
@ -78,9 +81,9 @@
|
|||
['OS=="win"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<(libchromiumcontent_library_dir)/base_static.lib',
|
||||
'<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib',
|
||||
'<(libchromiumcontent_library_dir)/sandbox_static.lib',
|
||||
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/base_static.lib',
|
||||
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib',
|
||||
'<(brightray_source_root)/<(libchromiumcontent_library_dir)/sandbox_static.lib',
|
||||
],
|
||||
},
|
||||
}],
|
||||
|
|
9
brightray/tools/brightray_source_root.py
Normal file
9
brightray/tools/brightray_source_root.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
"""Prints the absolute path of the root of brightray's source tree.
|
||||
"""
|
||||
|
||||
|
||||
print os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
Loading…
Reference in a new issue