0

Make *some* version of the Win GN build work.

R=scottmg@chromium.org, brettw@chromium.org
BUG=354261

Review URL: https://codereview.chromium.org/709593004

Cr-Commit-Position: refs/heads/master@{#303366}
This commit is contained in:
dpranke
2014-11-07 18:59:57 -08:00
committed by Commit bot
parent 22e04357bc
commit 4376059165
7 changed files with 145 additions and 55 deletions
BUILD.gn
base/allocator
build
config
secondary
third_party
crypto
third_party/zlib

@ -255,4 +255,67 @@ group("root") {
"//device/usb", "//device/usb",
] ]
} }
if (is_win) {
# TODO(GYP): Make these work.
deps -= [
"//apps",
"//ash",
"//chrome/browser",
"//chrome/browser/devtools",
"//chrome/common",
"//chrome/plugin",
"//chrome/renderer",
"//chrome/utility",
"//components:all_components",
"//cc",
"//cc/blink",
"//content",
"//content/shell:content_shell",
"//content/test:test_support",
"//device/bluetooth",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
"//extensions/renderer",
"//gpu",
"//google_apis",
"//google_apis/gcm",
"//jingle:notifier",
"//media",
"//media/blink",
"//media/cast",
"//media/mojo",
"//mojo",
"//pdf",
"//ppapi:ppapi_c",
"//printing",
"//remoting/client/plugin",
"//sandbox",
"//storage/browser",
"//sync",
"//third_party/WebKit/public:all_blink",
"//third_party/angle:translator",
"//third_party/leveldatabase",
"//third_party/libjingle",
"//third_party/usrsctp",
"//third_party/webrtc",
"//ui/accessibility",
"//ui/app_list",
"//ui/aura",
"//ui/base",
"//ui/display",
"//ui/events",
"//ui/gfx",
"//ui/gl",
"//ui/keyboard",
"//ui/native_theme",
"//ui/snapshot",
"//ui/surface",
"//ui/views",
"//ui/views/controls/webview",
"//ui/web_dialogs",
"//ui/wm",
]
}
} }

@ -37,7 +37,7 @@ if (is_win) {
} }
} }
if (!is_android) { if (use_allocator == "tcmalloc") {
# tcmalloc currently won't compile on Android. # tcmalloc currently won't compile on Android.
source_set("tcmalloc") { source_set("tcmalloc") {
tcmalloc_dir = "//third_party/tcmalloc/chromium" tcmalloc_dir = "//third_party/tcmalloc/chromium"

@ -1,8 +1,9 @@
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
if (is_android || cpu_arch == "mipsel" || is_mac || is_asan) { # TODO(GYP): Make tcmalloc work on win.
if (is_android || cpu_arch == "mipsel" || is_mac || is_asan || is_win) {
_default_allocator = "none" _default_allocator = "none"
} else { } else {
_default_allocator = "tcmalloc" _default_allocator = "tcmalloc"

@ -918,15 +918,28 @@ config("optimize_max") {
cflags = common_optimize_on_cflags cflags = common_optimize_on_cflags
ldflags = common_optimize_on_ldflags ldflags = common_optimize_on_ldflags
if (is_win) { if (is_win) {
cflags -= [
"/Os",
]
cflags += [ cflags += [
"/Ot", # Favor speed over size. "/Ot", # Favor speed over size.
"/GL", # Whole program optimization.
# Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds.
# Probably anything that this would catch that wouldn't be caught in a
# normal build isn't going to actually be a bug, so the incremental value
# of C4702 for PGO builds is likely very small.
"/wd4702",
] ]
if (is_official_build) {
# TODO(GYP): TODO(dpranke): Should these only be on in an official
# build, or on all the time? For now we'll require official build so
# that the compile is clean.
cflags += [
"/GL", # Whole program optimization.
# Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds.
# Probably anything that this would catch that wouldn't be caught in a
# normal build isn't going to actually be a bug, so the incremental
# value of C4702 for PGO builds is likely very small.
"/wd4702",
]
ldflags += [
"/LTCG",
]
}
} else { } else {
cflags += [ cflags += [
"-O2", "-O2",

@ -1159,6 +1159,10 @@ if (is_linux) {
"USE_HW_AES", "USE_HW_AES",
"INTEL_GCM", "INTEL_GCM",
] ]
sources -= [
"nss/lib/freebl/mpi/mpi_amd64.c",
]
} else if (cpu_arch == "x64") { } else if (cpu_arch == "x64") {
sources -= [ sources -= [
"nss/lib/freebl/intel-aes-x86-masm.asm", "nss/lib/freebl/intel-aes-x86-masm.asm",

@ -168,7 +168,9 @@ component("crypto") {
defines = [ "CRYPTO_IMPLEMENTATION" ] defines = [ "CRYPTO_IMPLEMENTATION" ]
} }
if (is_win) { # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff
# and make it work.
if (false && is_win) {
# A minimal crypto subset for hmac-related stuff that small standalone # A minimal crypto subset for hmac-related stuff that small standalone
# targets can use to reduce code size on Windows. This does not depend on # targets can use to reduce code size on Windows. This does not depend on
# OpenSSL/NSS but will use Windows APIs for that functionality. # OpenSSL/NSS but will use Windows APIs for that functionality.
@ -198,52 +200,55 @@ if (is_win) {
} }
} }
test("crypto_unittests") { # TODO(GYP): Make this link on win as well.
sources = [ if (!is_win) {
# Tests. test("crypto_unittests") {
"curve25519_unittest.cc", sources = [
"ec_private_key_unittest.cc", # Tests.
"ec_signature_creator_unittest.cc", "curve25519_unittest.cc",
"encryptor_unittest.cc", "ec_private_key_unittest.cc",
"ghash_unittest.cc", "ec_signature_creator_unittest.cc",
"hkdf_unittest.cc", "encryptor_unittest.cc",
"hmac_unittest.cc", "ghash_unittest.cc",
"nss_util_unittest.cc", "hkdf_unittest.cc",
"openssl_bio_string_unittest.cc", "hmac_unittest.cc",
"p224_unittest.cc", "nss_util_unittest.cc",
"p224_spake_unittest.cc", "openssl_bio_string_unittest.cc",
"random_unittest.cc", "p224_unittest.cc",
"rsa_private_key_unittest.cc", "p224_spake_unittest.cc",
"rsa_private_key_nss_unittest.cc", "random_unittest.cc",
"secure_hash_unittest.cc", "rsa_private_key_unittest.cc",
"sha2_unittest.cc",
"signature_creator_unittest.cc",
"signature_verifier_unittest.cc",
"symmetric_key_unittest.cc",
]
if (use_openssl || !is_linux) {
sources -= [
"rsa_private_key_nss_unittest.cc", "rsa_private_key_nss_unittest.cc",
"secure_hash_unittest.cc",
"sha2_unittest.cc",
"signature_creator_unittest.cc",
"signature_verifier_unittest.cc",
"symmetric_key_unittest.cc",
]
if (use_openssl || !is_linux) {
sources -= [
"rsa_private_key_nss_unittest.cc",
]
}
if (use_openssl) {
sources -= [ "nss_util_unittest.cc" ]
} else {
sources -= [ "openssl_bio_string_unittest.cc" ]
}
deps = [
":crypto",
":platform",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
] ]
} }
if (use_openssl) {
sources -= [ "nss_util_unittest.cc" ]
} else {
sources -= [ "openssl_bio_string_unittest.cc" ]
}
deps = [
":crypto",
":platform",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
} }
source_set("test_support") { source_set("test_support") {

@ -7,11 +7,15 @@ config("zlib_config") {
} }
static_library("zlib_x86_simd") { static_library("zlib_x86_simd") {
if (cpu_arch == "x86" || cpu_arch == "x64") { if (!is_win && (cpu_arch == "x86" || cpu_arch == "x64")) {
sources = [ "crc_folding.c", "fill_window_sse.c" ] sources = [ "crc_folding.c", "fill_window_sse.c" ]
cflags = [ "-msse2", "-msse4.2", "-mpclmul" ] cflags = [ "-msse2", "-msse4.2", "-mpclmul" ]
} else { } else {
sources = [ "simd_stub.c"] sources = [ "simd_stub.c"]
if (is_win) {
# TODO(GYP): crbug.com/431462 disable warning about structure padding.
cflags = [ "/wd4324" ]
}
} }
} }
@ -52,7 +56,7 @@ static_library("zlib") {
"zutil.h", "zutil.h",
] ]
if (cpu_arch == "x86" || cpu_arch == "x64") { if (!is_win && (cpu_arch == "x86" || cpu_arch == "x64")) {
sources += [ "x86.c" ] sources += [ "x86.c" ]
} }