Nobody actually needs to remove these, so I merged them with the runtime library configs that don't need to be referenced by the BUILDCONFIG.gn file.

This adds a posix BUILD.gn file. More stuff from the compiler config can go here in the future. For now, it just has the sysroot setup for Posix.

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

Cr-Original-Commit-Position: refs/heads/master@{#352077}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 888b65f239fb3154c4adbe3fb3c42eae164f1031
This commit is contained in:
brettw 2015-10-02 11:00:23 -07:00 коммит произвёл Commit bot
Родитель 39d8511c78
Коммит 3a42498307
9 изменённых файлов: 69 добавлений и 64 удалений

Просмотреть файл

@ -359,7 +359,6 @@ if (is_win) {
_native_compiler_configs += [
"//build/config/win:lean_and_mean",
"//build/config/win:nominmax",
"//build/config/win:sdk",
"//build/config/win:unicode",
"//build/config/win:winver",
]
@ -375,16 +374,6 @@ if (is_posix) {
]
}
if (is_linux) {
_native_compiler_configs += [ "//build/config/linux:sdk" ]
} else if (is_mac) {
_native_compiler_configs += [ "//build/config/mac:sdk" ]
} else if (is_ios) {
_native_compiler_configs += [ "//build/config/ios:sdk" ]
} else if (is_android) {
_native_compiler_configs += [ "//build/config/android:sdk" ]
}
if (is_android) {
_native_compiler_configs +=
[ "//build/config/android:default_cygprofile_instrumentation" ]

Просмотреть файл

@ -195,23 +195,6 @@ config("runtime_library") {
}
}
config("sdk") {
if (sysroot != "") {
cflags = [ "--sysroot=" + sysroot ]
asmflags = [ "--sysroot=" + sysroot ]
ldflags = [ "--sysroot=" + sysroot ]
# Need to get some linker flags out of the sysroot.
sysroot_ld_path = rebase_path("//build/config/linux/sysroot_ld_path.py")
ldflags += [ exec_script(sysroot_ld_path,
[
rebase_path("//build/linux/sysroot_ld_path.sh"),
sysroot,
],
"value") ]
}
}
config("executable_config") {
cflags = [ "-fPIE" ]
asmflags = [ "-fPIE" ]

Просмотреть файл

@ -493,10 +493,20 @@ config("runtime_library") {
# smaller.
if (is_win) {
configs += [ "//build/config/win:runtime_library" ]
} else if (is_linux) {
configs += [ "//build/config/linux:runtime_library" ]
} else if (is_ios) {
configs += [ "//build/config/ios:runtime_library" ]
} else if (is_mac) {
configs += [ "//build/config/mac:runtime_library" ]
} else if (is_android) {
configs += [ "//build/config/android:runtime_library" ]
}
if (is_posix) {
configs += [ "//build/config/posix:runtime_library" ]
}
if (is_component_build) {
defines += [ "COMPONENT_BUILD" ]
}

Просмотреть файл

@ -5,7 +5,11 @@
import("//build/config/sysroot.gni")
import("//build/config/ios/ios_sdk.gni")
config("sdk") {
# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is iOS-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
common_flags = [
"-isysroot",
sysroot,

Просмотреть файл

@ -7,21 +7,11 @@ import("//build/config/features.gni")
import("//build/config/sysroot.gni")
import("//build/config/ui.gni")
config("sdk") {
if (sysroot != "") {
cflags = [ "--sysroot=" + sysroot ]
ldflags = [ "--sysroot=" + sysroot ]
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",
[
rebase_path("//build/linux/sysroot_ld_path.sh",
root_build_dir),
sysroot,
],
"value") ]
}
# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is Linux-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
# Set here because OS_CHROMEOS cannot be autodetected in build_config.h like
# OS_LINUX and the like.
if (is_chromeos) {

Просмотреть файл

@ -5,7 +5,11 @@
import("//build/config/sysroot.gni")
import("//build/config/mac/mac_sdk.gni")
config("sdk") {
# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is Mac-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
common_flags = [
"-isysroot",
sysroot,

29
config/posix/BUILD.gn Normal file
Просмотреть файл

@ -0,0 +1,29 @@
# Copyright 2015 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.
import("//build/config/sysroot.gni")
assert(is_posix)
# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is Posix-only. Please see that target for advice on what should go in
# :runtime_library vs. :compiler.
config("runtime_library") {
if (!is_mac && sysroot != "") {
# Pass the sysroot to all C compiler variants, the assembler, and linker.
cflags = [ "--sysroot=" + sysroot ]
asmflags = cflags
ldflags = cflags
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("sysroot_ld_path.py",
[
rebase_path("//build/linux/sysroot_ld_path.sh",
root_build_dir),
sysroot,
],
"value") ]
}
}

Просмотреть файл

Просмотреть файл

@ -84,6 +84,7 @@ config("compiler") {
config("runtime_library") {
cflags = []
# Defines that set up the CRT.
defines = [
"__STD_C",
"_CRT_RAND_S",
@ -92,6 +93,20 @@ config("runtime_library") {
"_SCL_SECURE_NO_DEPRECATE",
]
# Defines that set up the Windows SDK.
defines += [
"_ATL_NO_OPENGL",
"_WINDOWS",
"CERT_CHAIN_PARA_HAS_EXTRA_FIELDS",
"NTDDI_VERSION=0x06030000",
"PSAPI_VERSION=1",
"WIN32",
"_SECURE_ATL",
# This is required for ATL to use XP-safe versions of its functions.
"_USING_V110_SDK71_",
]
if (is_component_build) {
# Component mode: dynamic CRT. Since the library is shared, it requires
# exceptions or will give errors about things not matching, so keep
@ -120,25 +135,6 @@ config("runtime_library") {
}
}
# Compiler setup for the Windows SDK. Applied to all targets.
config("sdk") {
# The include path is the stuff returned by the script.
#include_dirs = msvc_config[0] TODO(brettw) make this work.
defines = [
"_ATL_NO_OPENGL",
"_WINDOWS",
"CERT_CHAIN_PARA_HAS_EXTRA_FIELDS",
"NTDDI_VERSION=0x06030000",
"PSAPI_VERSION=1",
"WIN32",
"_SECURE_ATL",
# This is required for ATL to use XP-safe versions of its functions.
"_USING_V110_SDK71_",
]
}
# Sets the default Windows build version. This is separated because some
# targets need to manually override it for their compiles.
config("winver") {