From c94a74cb0a767ad12e6abd4dee772778439fb66b Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Sat, 21 Dec 2024 04:22:27 +0000 Subject: [PATCH] meson: use optimization level 3 and LTO by default --- nix-meson-build-support/common/meson.build | 4 ---- src/libcmd/meson.build | 3 ++- src/libexpr-c/meson.build | 3 ++- src/libexpr-test-support/meson.build | 3 ++- src/libexpr-tests/meson.build | 3 ++- src/libexpr/meson.build | 3 ++- src/libfetchers-tests/meson.build | 3 ++- src/libfetchers/meson.build | 3 ++- src/libflake-c/meson.build | 3 ++- src/libflake-tests/meson.build | 3 ++- src/libflake/meson.build | 3 ++- src/libmain-c/meson.build | 3 ++- src/libmain/meson.build | 3 ++- src/libstore-c/meson.build | 3 ++- src/libstore-test-support/meson.build | 3 ++- src/libstore-tests/meson.build | 3 ++- src/libstore/meson.build | 3 ++- src/libutil-c/meson.build | 3 ++- src/libutil-test-support/meson.build | 3 ++- src/libutil-tests/meson.build | 3 ++- src/libutil/meson.build | 3 ++- src/nix/meson.build | 3 ++- tests/functional/meson.build | 3 ++- 23 files changed, 44 insertions(+), 26 deletions(-) diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build index f0322183e8a..67b6658f594 100644 --- a/nix-meson-build-support/common/meson.build +++ b/nix-meson-build-support/common/meson.build @@ -16,7 +16,3 @@ add_project_arguments( '-Wno-deprecated-declarations', language : 'cpp', ) - -if get_option('buildtype') not in ['debug'] - add_project_arguments('-O3', language : 'cpp') -endif diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 222817c81e0..47a33693a6c 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -5,7 +5,8 @@ project('nix-cmd', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build index 1556dae519c..4930230f0dc 100644 --- a/src/libexpr-c/meson.build +++ b/src/libexpr-c/meson.build @@ -5,7 +5,8 @@ project('nix-expr-c', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build index 64d4fe21862..edb5e481b69 100644 --- a/src/libexpr-test-support/meson.build +++ b/src/libexpr-test-support/meson.build @@ -5,7 +5,8 @@ project('nix-expr-test-support', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libexpr-tests/meson.build b/src/libexpr-tests/meson.build index f37e85e5722..9edc236f164 100644 --- a/src/libexpr-tests/meson.build +++ b/src/libexpr-tests/meson.build @@ -5,7 +5,8 @@ project('nix-expr-tests', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index b3c559ba71c..f0b473f5493 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -5,7 +5,8 @@ project('nix-expr', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libfetchers-tests/meson.build b/src/libfetchers-tests/meson.build index 3e82c61110d..f4614f2fa80 100644 --- a/src/libfetchers-tests/meson.build +++ b/src/libfetchers-tests/meson.build @@ -5,7 +5,8 @@ project('nix-fetchers-tests', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index b4408e94318..60d1d54c8b8 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -5,7 +5,8 @@ project('nix-fetchers', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build index b7669fe9778..61986549180 100644 --- a/src/libflake-c/meson.build +++ b/src/libflake-c/meson.build @@ -5,7 +5,8 @@ project('nix-flake-c', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libflake-tests/meson.build b/src/libflake-tests/meson.build index 5c3c58e53a8..3d84284c9de 100644 --- a/src/libflake-tests/meson.build +++ b/src/libflake-tests/meson.build @@ -5,7 +5,8 @@ project('nix-flake-tests', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libflake/meson.build b/src/libflake/meson.build index f9e2177294e..921e8d7631b 100644 --- a/src/libflake/meson.build +++ b/src/libflake/meson.build @@ -5,7 +5,8 @@ project('nix-flake', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build index 5a5684b8d63..3900e80b54e 100644 --- a/src/libmain-c/meson.build +++ b/src/libmain-c/meson.build @@ -5,7 +5,8 @@ project('nix-main-c', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libmain/meson.build b/src/libmain/meson.build index 87fc8b8d29f..f513c384e60 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -5,7 +5,8 @@ project('nix-main', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build index 1ac331ad0fb..1a4dc55b6ec 100644 --- a/src/libstore-c/meson.build +++ b/src/libstore-c/meson.build @@ -5,7 +5,8 @@ project('nix-store-c', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build index 2a07e56ac7f..1de2cd5ae6e 100644 --- a/src/libstore-test-support/meson.build +++ b/src/libstore-test-support/meson.build @@ -5,7 +5,8 @@ project('nix-store-test-support', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libstore-tests/meson.build b/src/libstore-tests/meson.build index b706fa12c2f..d9477370649 100644 --- a/src/libstore-tests/meson.build +++ b/src/libstore-tests/meson.build @@ -5,7 +5,8 @@ project('nix-store-tests', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libstore/meson.build b/src/libstore/meson.build index 12a0e637644..614a693feae 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -5,7 +5,8 @@ project('nix-store', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail 'localstatedir=/nix/var', ], diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build index 44cec1afc8e..690ba300c86 100644 --- a/src/libutil-c/meson.build +++ b/src/libutil-c/meson.build @@ -5,7 +5,8 @@ project('nix-util-c', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build index 03ae63f1a31..e2643b1f6e3 100644 --- a/src/libutil-test-support/meson.build +++ b/src/libutil-test-support/meson.build @@ -5,7 +5,8 @@ project('nix-util-test-support', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libutil-tests/meson.build b/src/libutil-tests/meson.build index 83ac79e92b8..e8e5adb2227 100644 --- a/src/libutil-tests/meson.build +++ b/src/libutil-tests/meson.build @@ -5,7 +5,8 @@ project('nix-util-tests', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/libutil/meson.build b/src/libutil/meson.build index bbe7872cf10..03ccaec2084 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -5,7 +5,8 @@ project('nix-util', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.1', diff --git a/src/nix/meson.build b/src/nix/meson.build index 1d4840b1215..f737020ca96 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -5,7 +5,8 @@ project('nix', 'cpp', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail 'localstatedir=/nix/var', ], diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 933595cd5ef..7d720922b17 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -5,7 +5,8 @@ project('nix-functional-tests', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', - 'optimization=2', + 'optimization=3', + 'b_lto=true', 'errorlogs=true', # Please print logs for tests that fail ], meson_version : '>= 1.3',