diff options
-rw-r--r-- | BUILD.gn | 7 | ||||
-rw-r--r-- | build/config/compiler/BUILD.gn | 8 | ||||
-rw-r--r-- | rlz/BUILD.gn | 136 | ||||
-rw-r--r-- | tools/gn/secondary/third_party/icu/BUILD.gn | 9 | ||||
-rw-r--r-- | tools/gn/secondary/third_party/nss/BUILD.gn | 6 |
5 files changed, 156 insertions, 10 deletions
@@ -104,6 +104,13 @@ group("root") { ] } + if (is_win || is_mac || is_chromeos) { + # RLZ works on these platforms. + deps += [ + "//rlz:rlz_lib", + ] + } + if (is_android) { deps -= [ "//cc", diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index eb33be9..4520f3a 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -43,10 +43,14 @@ config("compiler") { cflags += [ "/Gy", # Enable function-level linking. "/GS", # Enable buffer security checking. - "/EHsc", # Assume C functions can't throw exceptions and don't catch - # structured exceptions (only C++ ones). "/FS", # Preserve previous PDB behavior. ] + if (is_component_build) { + cflags += [ + "/EHsc", # Assume C functions can't throw exceptions and don't catch + # structured exceptions (only C++ ones). + ] + } } else { # Common GCC compiler flags setup. # -------------------------------- diff --git a/rlz/BUILD.gn b/rlz/BUILD.gn new file mode 100644 index 0000000..a7e3991 --- /dev/null +++ b/rlz/BUILD.gn @@ -0,0 +1,136 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Note that this build file assumes rlz_use_chrome_net which is a condition in +# the GYP file, but is always true for Chrome builds. + +config("rlz_config") { + defines = [ "RLZ_NETWORK_IMPLEMENTATION_CHROME_NET" ] +} + +source_set("rlz_lib") { + sources = [ + "chromeos/lib/machine_id_chromeos.cc", + "chromeos/lib/rlz_value_store_chromeos.cc", + "chromeos/lib/rlz_value_store_chromeos.h", + "ios/lib/machine_id_ios.cc", + "lib/assert.cc", + "lib/assert.h", + "lib/crc32.h", + "lib/crc32_wrapper.cc", + "lib/crc8.h", + "lib/crc8.cc", + "lib/financial_ping.cc", + "lib/financial_ping.h", + "lib/lib_values.cc", + "lib/machine_id.cc", + "lib/machine_id.h", + "lib/recursive_cross_process_lock_posix.cc", + "lib/recursive_cross_process_lock_posix.h", + "lib/rlz_enums.h", + "lib/rlz_lib.cc", + "lib/rlz_lib.h", + "lib/rlz_lib_clear.cc", + "lib/lib_values.h", + "lib/rlz_value_store.h", + "lib/string_utils.cc", + "lib/string_utils.h", + "mac/lib/machine_id_mac.cc", + "mac/lib/rlz_value_store_mac.mm", + "mac/lib/rlz_value_store_mac.h", + "win/lib/lib_mutex.cc", + "win/lib/lib_mutex.h", + "win/lib/machine_deal.cc", + "win/lib/machine_deal.h", + "win/lib/machine_id_win.cc", + "win/lib/process_info.cc", + "win/lib/process_info.h", + "win/lib/registry_util.cc", + "win/lib/registry_util.h", + "win/lib/rlz_lib_win.cc", + "win/lib/rlz_value_store_registry.cc", + "win/lib/rlz_value_store_registry.h", + ] + + direct_dependent_configs = [ ":rlz_config" ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//net", + ] + + if (is_ios) { + # These _mac files are also used on iOS. + set_sources_assignment_filter([]) + sources += [ + "mac/lib/rlz_value_store_mac.mm", + "mac/lib/rlz_value_store_mac.h", + ] + set_sources_assignment_filter(sources_assignment_filter) + } else if (is_win) { + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + cflags = [ "/wd4267" ] + } +} + +source_set("test_support") { + sources = [ + "test/rlz_test_helpers.cc", + "test/rlz_test_helpers.h", + ] + deps = [ + ":rlz_lib", + "//base", + "//base/test:test_support", + "//testing/gtest", + ] +} + +test("rlz_unittests") { + sources = [ + "lib/crc32_unittest.cc", + "lib/crc8_unittest.cc", + "lib/financial_ping_test.cc", + "lib/lib_values_unittest.cc", + "lib/machine_id_unittest.cc", + "lib/rlz_lib_test.cc", + "lib/string_utils_unittest.cc", + "test/rlz_unittest_main.cc", + "win/lib/machine_deal_test.cc", + ] + + deps = [ + ":rlz_lib", + ":test_support", + "//base", + "//base:prefs", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + "//third_party/zlib", + ] +} + +executable("rlz_id") { + sources = [ + "examples/rlz_id.cc", + ] + deps = [ + ":rlz_lib", + ] +} + +if (is_win) { + shared_library("rlz") { + sources = [ + "win/dll/dll_main.cc", + "win/dll/exports.cc", + ] + deps = [ + ":rlz_lib", + "//third_party/zlib", + ] + } +} diff --git a/tools/gn/secondary/third_party/icu/BUILD.gn b/tools/gn/secondary/third_party/icu/BUILD.gn index e4d030a..df268cb 100644 --- a/tools/gn/secondary/third_party/icu/BUILD.gn +++ b/tools/gn/secondary/third_party/icu/BUILD.gn @@ -16,6 +16,11 @@ config("icu_config") { defines = [ "U_USING_ICU_NAMESPACE=0", ] + + if (component_mode != "shared_library") { + defines += [ "U_STATIC_IMPLEMENTATION" ] + } + include_dirs = [ "source/common", "source/i18n", @@ -24,10 +29,6 @@ config("icu_config") { # Config used only by ICU code. config("icu_code") { - if (component_mode != "shared_library") { - defines = [ "U_STATIC_IMPLEMENTATION" ] - } - if (is_win) { # Disable some compiler warnings. cflags = [ diff --git a/tools/gn/secondary/third_party/nss/BUILD.gn b/tools/gn/secondary/third_party/nss/BUILD.gn index acb96a6..a0c1674 100644 --- a/tools/gn/secondary/third_party/nss/BUILD.gn +++ b/tools/gn/secondary/third_party/nss/BUILD.gn @@ -1090,10 +1090,6 @@ if (is_linux) { } if (is_win) { - sources -= [ - "nss/lib/freebl/mpi/mpi_amd64.c", - "nss/lib/freebl/mpi/mpi_x86_asm.c", - ] defines += [ "SHLIB_SUFFIX=\"dll\"", "SHLIB_PREFIX=\"\"", @@ -1104,6 +1100,7 @@ if (is_linux) { ] if (cpu_arch == "x86") { + sources -= [ "nss/lib/freebl/mpi/mpi_amd64.c" ] defines += [ "NSS_X86_OR_X64", "NSS_X86", @@ -1115,6 +1112,7 @@ if (is_linux) { "MP_NO_MP_WORD", ] } else if (cpu_arch == "x64") { + sources -= [ "nss/lib/freebl/mpi/mpi_x86_asm.c" ] defines += [ "NSS_USE_64", "NSS_X86_OR_X64", |