diff options
author | Peter Bright <drpizza@quiscalusmexicanus.org> | 2011-08-13 19:17:47 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-13 19:57:42 -0700 |
commit | 16788f461aedaca7eb7fc658b6b115ac8a3f5d62 (patch) | |
tree | efae2cd898497c995bf774bd95fd7f8206eeae82 /tools | |
parent | a5d90c435cb7af5fafe5b370e412e1b965d24114 (diff) | |
download | nodejs-16788f461aedaca7eb7fc658b6b115ac8a3f5d62.tar.gz nodejs-16788f461aedaca7eb7fc658b6b115ac8a3f5d62.tar.bz2 nodejs-16788f461aedaca7eb7fc658b6b115ac8a3f5d62.zip |
Rename gyp files to produce useful solution names.
Hoist common settings into common.gypi.
Restrict v8's common.gypi to v8 projects.
Ensure v8 doesn't use /MP in debug builds.
Add basic settings for other platforms.
Make uv import common.gypi properly.
Remove LTCG warning.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/common.gypi | 141 | ||||
-rw-r--r-- | tools/gyp/pylib/gyp/input.py | 2 | ||||
-rwxr-xr-x | tools/gyp_node | 10 |
3 files changed, 11 insertions, 142 deletions
diff --git a/tools/common.gypi b/tools/common.gypi deleted file mode 100644 index e1ab09506..000000000 --- a/tools/common.gypi +++ /dev/null @@ -1,141 +0,0 @@ -{ - 'variables': { - 'library%': 'static_library', - 'component%': 'static_library', - 'visibility%': 'hidden', - 'variables': { - 'conditions': [ - [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { - # This handles the Linux platforms we generally deal with. Anything - # else gets passed through, which probably won't work very well; such - # hosts should pass an explicit target_arch to gyp. - 'host_arch%': - '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', - }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd" - 'host_arch%': 'ia32', - }], - ], - }, - 'host_arch%': '<(host_arch)', - 'target_arch%': '<(host_arch)', - 'v8_target_arch%': '<(target_arch)', - }, - 'target_defaults': { - 'default_configuration': 'Debug', - 'configurations': { - 'Debug': { - 'cflags': [ '-g', '-O0' ], - 'defines': [ '_DEBUG', 'DEBUG' ], - }, - 'Release': { - 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ], - }, - }, - }, - 'conditions': [ - [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { - 'target_defaults': { - 'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ], - 'ldflags': [ '-pthread', ], - 'conditions': [ - [ 'target_arch=="ia32"', { - 'cflags': [ '-m32' ], - 'ldflags': [ '-m32' ], - }], - [ 'OS=="linux"', { - 'cflags': [ '-ansi' ], - }], - [ 'visibility=="hidden"', { - 'cflags': [ '-fvisibility=hidden' ], - }], - ], - }, - }], # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"' - ['OS=="win"', { - 'target_defaults': { - 'defines': [ - 'WIN32', - '_CRT_SECURE_NO_DEPRECATE', - '_CRT_NONSTDC_NO_DEPRECATE', - ], - 'conditions': [ - ['component=="static_library"', { - 'defines': [ - '_HAS_EXCEPTIONS=0', - ], - }], - ], - 'msvs_disabled_warnings': [4355, 4800], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'MinimalRebuild': 'false', - 'BufferSecurityCheck': 'true', - 'EnableFunctionLevelLinking': 'true', - 'RuntimeTypeInfo': 'false', - 'WarningLevel': '3', - 'WarnAsError': 'true', - 'DebugInformationFormat': '3', - 'Detect64BitPortabilityProblems': 'false', - 'conditions': [ - [ 'msvs_multi_core_compile', { - 'AdditionalOptions': ['/MP'], - }], - ['component=="shared_library"', { - 'ExceptionHandling': '1', # /EHsc - }, { - 'ExceptionHandling': '0', - }], - ], - }, - 'VCLibrarianTool': { - 'AdditionalOptions': ['/ignore:4221'], - }, - 'VCLinkerTool': { - 'AdditionalDependencies': [ - ], - 'GenerateDebugInformation': 'true', - }, - }, - }, - }], # OS=="win" - ['OS=="mac"', { - 'target_defaults': { - 'xcode_settings': { - 'ALWAYS_SEARCH_USER_PATHS': 'NO', - 'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi - 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks - 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic - # (Equivalent to -fPIC) - 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions - 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti - 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings - # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden - 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden - 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics - 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror - 'GCC_VERSION': '4.2', - 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof - 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4 - 'PREBINDING': 'NO', # No -Wl,-prebind - 'USE_HEADERMAP': 'NO', - 'OTHER_CFLAGS': [ - '-fno-strict-aliasing', - ], - 'WARNING_CFLAGS': [ - '-Wall', - '-Wendif-labels', - '-W', - '-Wno-unused-parameter', - '-Wnon-virtual-dtor', - ], - }, - 'target_conditions': [ - ['_type!="static_library"', { - 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']}, - }], - ], # target_conditions - }, # target_defaults - }], # OS=="mac" - ], -} diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py index 314b5c66d..8a44d4e99 100644 --- a/tools/gyp/pylib/gyp/input.py +++ b/tools/gyp/pylib/gyp/input.py @@ -413,7 +413,7 @@ def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes, index = index + 1 else: raise Exception, \ - "Unable to find targets in build file %s" % build_file_path + "Unable to find targets in build file %s" % os.path.abspath(build_file_path) # No longer needed. del build_file_data['target_defaults'] diff --git a/tools/gyp_node b/tools/gyp_node index d783b1dba..07da2ee45 100755 --- a/tools/gyp_node +++ b/tools/gyp_node @@ -28,17 +28,27 @@ if __name__ == '__main__': # On Mac/make it will crash if it doesn't get an absolute path. if sys.platform == 'win32': args.append(os.path.join(node_root, 'node.gyp')) + common_fn = os.path.join(node_root, 'common.gypi') options_fn = os.path.join(node_root, 'options.gypi') else: args.append(os.path.join(os.path.abspath(node_root), 'node.gyp')) + common_fn = os.path.join(os.path.abspath(node_root), 'common.gypi') options_fn = os.path.join(os.path.abspath(node_root), 'options.gypi') + if os.path.exists(common_fn): + args.extend(['-I', common_fn]) + if os.path.exists(options_fn): args.extend(['-I', options_fn]) args.append('--depth=' + node_root) + # There's a bug with windows which doesn't allow this feature. if sys.platform != 'win32': + + # Tell gyp to write the Makefiles into output_dir + args.extend(['--generator-output', output_dir]) + # Tell make to write its output into the same dir args.extend(['-Goutput_dir=' + output_dir]) |