From 5a37d2276f14d826bd02554fd2a97d0b3973f2e6 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Fri, 29 Aug 2014 11:18:50 +0000 Subject: [PATCH] Move base library definitions from v8.gyp to base.gyp. Less confusion is best confusion. R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/518023002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- build/all.gyp | 2 +- src/base/base.gyp | 251 ++++++++++++++++++++++++++++++++++++++++++++- tools/gyp/v8.gyp | 253 +--------------------------------------------- 3 files changed, 253 insertions(+), 253 deletions(-) diff --git a/build/all.gyp b/build/all.gyp index 6ac415acb7..8ac10ef0ee 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -9,7 +9,7 @@ 'type': 'none', 'dependencies': [ '../samples/samples.gyp:*', - '../src/base/base.gyp:*', + '../src/base/base.gyp:base-unittests', '../src/d8.gyp:d8', '../test/cctest/cctest.gyp:*', '../test/compiler-unittests/compiler-unittests.gyp:*', diff --git a/src/base/base.gyp b/src/base/base.gyp index 6b1b8f2ab4..33d9b14309 100644 --- a/src/base/base.gyp +++ b/src/base/base.gyp @@ -8,13 +8,262 @@ }, 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], 'targets': [ + { + 'target_name': 'base', + 'type': 'static_library', + 'variables': { + 'optimize': 'max', + }, + 'include_dirs+': [ + '../..', + ], + 'sources': [ + 'atomicops.h', + 'atomicops_internals_arm64_gcc.h', + 'atomicops_internals_arm_gcc.h', + 'atomicops_internals_atomicword_compat.h', + 'atomicops_internals_mac.h', + 'atomicops_internals_mips_gcc.h', + 'atomicops_internals_tsan.h', + 'atomicops_internals_x86_gcc.cc', + 'atomicops_internals_x86_gcc.h', + 'atomicops_internals_x86_msvc.h', + 'bits.h', + 'build_config.h', + 'cpu.cc', + 'cpu.h', + 'flags.h', + 'lazy-instance.h', + 'logging.cc', + 'logging.h', + 'macros.h', + 'once.cc', + 'once.h', + 'platform/elapsed-timer.h', + 'platform/time.cc', + 'platform/time.h', + 'platform/condition-variable.cc', + 'platform/condition-variable.h', + 'platform/mutex.cc', + 'platform/mutex.h', + 'platform/platform.h', + 'platform/semaphore.cc', + 'platform/semaphore.h', + 'safe_conversions.h', + 'safe_conversions_impl.h', + 'safe_math.h', + 'safe_math_impl.h', + 'sys-info.cc', + 'sys-info.h', + 'utils/random-number-generator.cc', + 'utils/random-number-generator.h', + ], + 'conditions': [ + ['want_separate_host_toolset==1', { + 'toolsets': ['host', 'target'], + }, { + 'toolsets': ['target'], + }], + ['OS=="linux"', { + 'link_settings': { + 'libraries': [ + '-lrt' + ] + }, + 'sources': [ + 'platform/platform-linux.cc', + 'platform/platform-posix.cc' + ], + } + ], + ['OS=="android"', { + 'sources': [ + 'platform/platform-posix.cc' + ], + 'conditions': [ + ['host_os=="mac"', { + 'target_conditions': [ + ['_toolset=="host"', { + 'sources': [ + 'platform/platform-macos.cc' + ] + }, { + 'sources': [ + 'platform/platform-linux.cc' + ] + }], + ], + }, { + # TODO(bmeurer): What we really want here, is this: + # + # 'link_settings': { + # 'target_conditions': [ + # ['_toolset=="host"', { + # 'libraries': [ + # '-lrt' + # ] + # }] + # ] + # }, + # + # but we can't do this right now, as the AOSP does not support + # linking against the host librt, so we need to work around this + # for now, using the following hack (see platform/time.cc): + 'target_conditions': [ + ['_toolset=="host"', { + 'defines': [ + 'V8_LIBRT_NOT_AVAILABLE=1', + ], + }], + ], + 'sources': [ + 'platform/platform-linux.cc' + ] + }], + ], + }, + ], + ['OS=="qnx"', { + 'link_settings': { + 'target_conditions': [ + ['_toolset=="host" and host_os=="linux"', { + 'libraries': [ + '-lrt' + ], + }], + ['_toolset=="target"', { + 'libraries': [ + '-lbacktrace' + ], + }], + ], + }, + 'sources': [ + 'platform/platform-posix.cc', + 'qnx-math.h', + ], + 'target_conditions': [ + ['_toolset=="host" and host_os=="linux"', { + 'sources': [ + 'platform/platform-linux.cc' + ], + }], + ['_toolset=="host" and host_os=="mac"', { + 'sources': [ + 'platform/platform-macos.cc' + ], + }], + ['_toolset=="target"', { + 'sources': [ + 'platform/platform-qnx.cc' + ], + }], + ], + }, + ], + ['OS=="freebsd"', { + 'link_settings': { + 'libraries': [ + '-L/usr/local/lib -lexecinfo', + ]}, + 'sources': [ + 'platform/platform-freebsd.cc', + 'platform/platform-posix.cc' + ], + } + ], + ['OS=="openbsd"', { + 'link_settings': { + 'libraries': [ + '-L/usr/local/lib -lexecinfo', + ]}, + 'sources': [ + 'platform/platform-openbsd.cc', + 'platform/platform-posix.cc' + ], + } + ], + ['OS=="netbsd"', { + 'link_settings': { + 'libraries': [ + '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo', + ]}, + 'sources': [ + 'platform/platform-openbsd.cc', + 'platform/platform-posix.cc' + ], + } + ], + ['OS=="solaris"', { + 'link_settings': { + 'libraries': [ + '-lnsl', + ]}, + 'sources': [ + 'platform/platform-solaris.cc', + 'platform/platform-posix.cc' + ], + } + ], + ['OS=="mac"', { + 'sources': [ + 'platform/platform-macos.cc', + 'platform/platform-posix.cc' + ]}, + ], + ['OS=="win"', { + 'defines': [ + '_CRT_RAND_S' # for rand_s() + ], + 'variables': { + 'gyp_generators': '