Merge pull request #11955 from electron/official_build

Official build for 1.8
This commit is contained in:
Cheng Zhao
2018-02-22 18:59:23 +09:00
committed by GitHub
10 changed files with 84 additions and 41 deletions

View File

@@ -6,7 +6,7 @@ jobs:
- image: electronbuilds/electron:0.0.3
environment:
TARGET_ARCH: arm
resource_class: xlarge
resource_class: 2xlarge
steps:
- checkout
- run:
@@ -63,7 +63,7 @@ jobs:
- image: electronbuilds/electron:0.0.3
environment:
TARGET_ARCH: arm64
resource_class: xlarge
resource_class: 2xlarge
steps:
- checkout
- run:
@@ -262,6 +262,7 @@ jobs:
- run: npm run lint
- run:
name: Build
no_output_timeout: 30m
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'

View File

@@ -227,10 +227,8 @@
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': '2', # /MD (nondebug DLL)
# 1, optimizeMinSpace, Minimize Size (/O1)
'Optimization': '1',
# 2, favorSize - Favor small code (/Os)
'FavorSizeOrSpeed': '2',
'Optimization': '2', # /O2
'WholeProgramOptimization': 'true', # /GL
# See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
'InlineFunctionExpansion': '2', # 2 = max
# See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
@@ -242,6 +240,9 @@
# "/Oy /Oy-" and warnings about overriding.
'AdditionalOptions': ['/Oy-', '/d2guard4'],
},
'VCLibrarianTool': {
'LinkTimeCodeGeneration': 'true', # /LTCG
},
'VCLinkerTool': {
# Control Flow Guard is a security feature in Windows
# 8.1 and higher designed to prevent exploitation of
@@ -252,6 +253,9 @@
'AdditionalOptions': ['/guard:cf'],
# Turn off incremental linking to save binary size.
'LinkIncremental': '1', # /INCREMENTAL:NO
'LinkTimeCodeGeneration': '1', # /LTCG
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
},
},
'conditions': [
@@ -272,10 +276,26 @@
# Specifically tell the linker to perform optimizations.
# See http://lwn.net/Articles/192624/ .
'-Wl,-O1',
'-Wl,--as-needed',
'-Wl,--gc-sections',
],
}], # OS=="linux"
['OS=="linux" and target_arch!="mips64el"', {
'ldflags': [
'-Wl,--as-needed',
],
}],
['OS=="linux" and target_arch in ["ia32", "x64", "arm64"]', {
'cflags': [
'-flto',
],
'ldflags': [
'-flto',
'-fuse-ld=gold',
'-Wl,-plugin-opt,O1',
'-Wl,-plugin-opt,-function-sections',
'-Wl,--icf=all',
],
}],
],
}, # Release_Base
'conditions': [

View File

@@ -174,7 +174,7 @@ void DesktopNotificationController::AnimateAll() {
if (SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0)) {
ScreenMetrics metrics;
POINT origin = { work_area.right,
work_area.bottom - metrics.Y(toast_margin_<int>) };
work_area.bottom - metrics.Y(toast_margin_) };
auto hdwp =
BeginDeferWindowPos(static_cast<int>(instances_.size()));
@@ -231,7 +231,7 @@ void DesktopNotificationController::AnimateAll() {
// Set new toast positions
if (!instances_.empty()) {
ScreenMetrics metrics;
auto margin = metrics.Y(toast_margin_<int>);
auto margin = metrics.Y(toast_margin_);
int target_pos = 0;
for (auto&& inst : instances_) {
@@ -305,7 +305,7 @@ void DesktopNotificationController::CreateToast(NotificationLink&& data) {
auto toast = Toast::Get(item.hwnd);
toast_pos = toast->GetVerticalPosition() +
toast->GetHeight() +
scr.Y(toast_margin_<int>);
scr.Y(toast_margin_);
}
instances_.push_back({ hwnd, move(data) });

View File

@@ -36,8 +36,7 @@ class DesktopNotificationController {
TimerID_Animate = 1
};
template<typename T>
static constexpr T toast_margin_ = 20;
static constexpr int toast_margin_ = 20;
// Wrapper around `NotificationData` which makes sure that
// the `controller` member is cleared when the controller object

View File

@@ -140,6 +140,12 @@
'<(libchromiumcontent_src_dir)/v8',
'<(libchromiumcontent_src_dir)/v8/include',
],
'defines': [
# Export V8 symbols from node.dll / libnode.so
'BUILDING_V8_SHARED',
'BUILDING_V8_PLATFORM_SHARED',
'BUILDING_V8_BASE_SHARED',
],
'conditions': [
['OS=="mac" and libchromiumcontent_component==0', {
# -all_load is the "whole-archive" on macOS.

View File

@@ -217,6 +217,11 @@
],
},
],
'link_settings': {
'ldflags': [
'-Wl,-z,noexecstack',
],
},
}], # OS=="linux"
],
}, # target <(project_name)

View File

@@ -12,7 +12,7 @@
"dugite": "^1.45.0",
"electabul": "~0.0.4",
"electron-docs-linter": "^2.3.4",
"electron-typescript-definitions": "^1.2.11",
"electron-typescript-definitions": "~1.2.11",
"github": "^9.2.0",
"husky": "^0.14.3",
"minimist": "^1.2.0",

View File

@@ -45,32 +45,42 @@ rm -f "${STAMP_FILE}"
# Check if there's a prebuilt binary and if so just fetch that. That's faster,
# and goma relies on having matching binary hashes on client and server too.
CDS_FILE="clang-${PACKAGE_VERSION}.tgz"
CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
if [ "${OS}" = "Linux" ]; then
CDS_FULL_URL="${CDS_URL}/Linux_x64/${CDS_FILE}"
elif [ "${OS}" = "Darwin" ]; then
CDS_FULL_URL="${CDS_URL}/Mac/${CDS_FILE}"
fi
echo Trying to download prebuilt clang
if which curl > /dev/null; then
curl -L --fail "${CDS_FULL_URL}" -o "${CDS_OUTPUT}" || \
rm -rf "${CDS_OUT_DIR}"
elif which wget > /dev/null; then
wget "${CDS_FULL_URL}" -O "${CDS_OUTPUT}" || rm -rf "${CDS_OUT_DIR}"
else
echo "Neither curl nor wget found. Please install one of these."
exit 1
fi
if [ -f "${CDS_OUTPUT}" ]; then
rm -rf "${LLVM_BUILD_DIR}"
mkdir -p "${LLVM_BUILD_DIR}"
tar -xzf "${CDS_OUTPUT}" -C "${LLVM_BUILD_DIR}"
echo clang "${PACKAGE_VERSION}" unpacked
echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
rm -rf "${CDS_OUT_DIR}"
exit 0
else
echo Did not find prebuilt clang "${PACKAGE_VERSION}", building
rm -rf "${LLVM_BUILD_DIR}"
mkdir -p "${LLVM_BUILD_DIR}"
CDS_FILES=("clang-${PACKAGE_VERSION}.tgz")
CDS_OUT_DIR=$(mktemp -d -t clang_download.XXXXXX)
if [ "${OS}" = "Linux" ]; then
CDS_FILES+=("llvmgold-${PACKAGE_VERSION}.tgz")
CDS_SUBDIR="Linux_x64"
elif [ "${OS}" = "Darwin" ]; then
CDS_SUBDIR="Mac"
fi
for CDS_FILE in "${CDS_FILES[@]}"
do
CDS_OUTPUT="${CDS_OUT_DIR}/${CDS_FILE}"
CDS_FULL_URL="${CDS_URL}/${CDS_SUBDIR}/${CDS_FILE}"
if which curl > /dev/null; then
curl -L --fail "${CDS_FULL_URL}" -o "${CDS_OUTPUT}" || \
rm -rf "${CDS_OUT_DIR}"
elif which wget > /dev/null; then
wget "${CDS_FULL_URL}" -O "${CDS_OUTPUT}" || rm -rf "${CDS_OUT_DIR}"
else
echo "Neither curl nor wget found. Please install one of these."
exit 1
fi
if [ -f "${CDS_OUTPUT}" ]; then
tar -xzf "${CDS_OUTPUT}" -C "${LLVM_BUILD_DIR}"
else
echo Did not find prebuilt clang "${PACKAGE_VERSION}"
exit 1
fi
done
echo clang "${PACKAGE_VERSION}" unpacked
echo "${PACKAGE_VERSION}" > "${STAMP_FILE}"
rm -rf "${CDS_OUT_DIR}"
exit 0

View File

@@ -104,8 +104,10 @@
# Setup building with clang.
['clang==1', {
'make_global_settings': [
['AR', '<(make_clang_dir)/bin/llvm-ar'],
['CC', '<(make_clang_dir)/bin/clang'],
['CXX', '<(make_clang_dir)/bin/clang++'],
['AR.host', '<(make_clang_dir)/bin/llvm-ar'],
['CC.host', '$(CC)'],
['CXX.host', '$(CXX)'],
],