From 01386739e3e110095d9a4071d168a2b7a7d32fc5 Mon Sep 17 00:00:00 2001 From: Cyano Hao Date: Fri, 2 Apr 2021 11:33:47 +0800 Subject: [PATCH] enable lto --- CMakeLists.txt | 2 +- package/dev.sh | 2 +- package/linux.sh | 1 + package/mac.sh | 1 + package/win32.sh | 1 + package/winarm.sh | 1 + package/winx86.sh | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d919662..da779d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) # C++20 requires 3.12 +cmake_minimum_required(VERSION 3.12) project(WFM_all) include(CheckLibraryExists) diff --git a/package/dev.sh b/package/dev.sh index 15429b2..dea2e59 100644 --- a/package/dev.sh +++ b/package/dev.sh @@ -1,7 +1,7 @@ #!/bin/bash cmake . -B build/ \ - -DCMAKE_BUILD_TYPE="Release" + -DCMAKE_BUILD_TYPE="RelWithDebugInfo" cmake --build build/ -j$(nproc) source build/config/config.sh diff --git a/package/linux.sh b/package/linux.sh index 274d1c7..d8539a0 100644 --- a/package/linux.sh +++ b/package/linux.sh @@ -2,6 +2,7 @@ cmake . -B build/ \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL="ON" \ -DCMAKE_C_COMPILER="x86_64-gentoo-linux-musl-gcc" \ -DCMAKE_C_FLAGS="-static-pie -s" \ -DCMAKE_CXX_COMPILER="x86_64-gentoo-linux-musl-g++" \ diff --git a/package/mac.sh b/package/mac.sh index d7f8265..a4708f4 100644 --- a/package/mac.sh +++ b/package/mac.sh @@ -2,6 +2,7 @@ cmake . -B build/ \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL="ON" \ -DCMAKE_C_COMPILER="clang" \ -DCMAKE_C_FLAGS="-arch x86_64 -arch arm64" \ -DCMAKE_CXX_COMPILER="clang++" \ diff --git a/package/win32.sh b/package/win32.sh index 327ef79..6df220f 100644 --- a/package/win32.sh +++ b/package/win32.sh @@ -2,6 +2,7 @@ cmake . -B build/ \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL="ON" \ -DCMAKE_C_COMPILER="i686-w64-mingw32-gcc" \ -DCMAKE_C_FLAGS="-static -s -Wl,--large-address-aware" \ -DCMAKE_CXX_COMPILER="i686-w64-mingw32-g++" \ diff --git a/package/winarm.sh b/package/winarm.sh index f4a82b8..540ab61 100644 --- a/package/winarm.sh +++ b/package/winarm.sh @@ -2,6 +2,7 @@ cmake . -B build/ -G "MinGW Makefiles" \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL="ON" \ -DCMAKE_C_COMPILER="aarch64-w64-mingw32-clang" \ -DCMAKE_C_FLAGS="-static -s" \ -DCMAKE_CXX_COMPILER="aarch64-w64-mingw32-clang++" \ diff --git a/package/winx86.sh b/package/winx86.sh index 0211306..accd369 100644 --- a/package/winx86.sh +++ b/package/winx86.sh @@ -2,6 +2,7 @@ cmake . -B build/ \ -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL="ON" \ -DCMAKE_C_COMPILER="x86_64-w64-mingw32-gcc" \ -DCMAKE_C_FLAGS="-static -s" \ -DCMAKE_CXX_COMPILER="x86_64-w64-mingw32-g++" \