Skip to content

Commit

Permalink
Merge pull request NixOS#11934 from DeterminateSystems/fix-optimization
Browse files Browse the repository at this point in the history
Use -O3 again
  • Loading branch information
Ericson2314 authored Nov 22, 2024
2 parents ba07446 + ed120a6 commit 09e989f
Show file tree
Hide file tree
Showing 23 changed files with 42 additions and 75 deletions.
22 changes: 22 additions & 0 deletions build-utils-meson/common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This is only conditional to work around
# https://github.com/mesonbuild/meson/issues/13293. It should be
# unconditional.
if not (host_machine.system() == 'windows' and cxx.get_id() == 'gcc')
deps_private += dependency('threads')
endif

add_project_arguments(
'-Wdeprecated-copy',
'-Werror=suggest-override',
'-Werror=switch',
'-Werror=switch-enum',
'-Werror=unused-result',
'-Wignored-qualifiers',
'-Wimplicit-fallthrough',
'-Wno-deprecated-declarations',
language : 'cpp',
)

if get_option('buildtype') not in ['debug']
add_project_arguments('-O3', language : 'cpp')
endif
11 changes: 0 additions & 11 deletions build-utils-meson/diagnostics/meson.build

This file was deleted.

6 changes: 0 additions & 6 deletions build-utils-meson/threads/meson.build

This file was deleted.

4 changes: 1 addition & 3 deletions src/libcmd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json

Expand Down Expand Up @@ -72,7 +70,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'built-path.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libexpr-c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

Expand All @@ -55,7 +53,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'nix_api_expr.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libexpr-test-support/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

rapidcheck = dependency('rapidcheck')
deps_public += rapidcheck

Expand All @@ -41,7 +39,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'tests/value/context.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libexpr-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand All @@ -51,7 +49,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'derived-path.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libexpr/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

boost = dependency(
'boost',
modules : ['container', 'context'],
Expand Down Expand Up @@ -79,7 +77,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

parser_tab = custom_target(
input : 'parser.y',
Expand Down
4 changes: 1 addition & 3 deletions src/libfetchers-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand All @@ -44,7 +42,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'public-key.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libfetchers/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json

Expand All @@ -43,7 +41,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'attrs.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libflake-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand All @@ -44,7 +42,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'flakeref.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libflake/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json

Expand All @@ -41,7 +39,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'flake/config.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libmain-c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

Expand All @@ -55,7 +53,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'nix_api_main.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libmain/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

pubsetbuf_test = '''
#include <iostream>
Expand Down Expand Up @@ -60,7 +58,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'common-args.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libstore-c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

Expand All @@ -51,7 +49,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'nix_api_store.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libstore-test-support/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

rapidcheck = dependency('rapidcheck')
deps_public += rapidcheck

Expand All @@ -38,7 +36,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'tests/derived-path.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libstore-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand All @@ -52,7 +50,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'common-protocol.cc',
Expand Down
3 changes: 1 addition & 2 deletions src/libstore/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ if host_machine.system() == 'windows'
endif

subdir('build-utils-meson/libatomic')
subdir('build-utils-meson/threads')

boost = dependency(
'boost',
Expand Down Expand Up @@ -180,7 +179,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'binary-cache-store.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libutil-c/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

Expand All @@ -47,7 +45,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'nix_api_util.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libutil-test-support/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

rapidcheck = dependency('rapidcheck')
deps_public += rapidcheck

Expand All @@ -35,7 +33,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'tests/hash.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/libutil-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand All @@ -44,7 +42,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'args.cc',
Expand Down
3 changes: 1 addition & 2 deletions src/libutil/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ endforeach
configdata.set('HAVE_DECL_AT_SYMLINK_NOFOLLOW', cxx.has_header_symbol('fcntl.h', 'AT_SYMLINK_NOFOLLOW').to_int())

subdir('build-utils-meson/libatomic')
subdir('build-utils-meson/threads')

if host_machine.system() == 'windows'
socket = cxx.find_library('ws2_32')
Expand Down Expand Up @@ -121,7 +120,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')

sources = files(
'archive.cc',
Expand Down
4 changes: 1 addition & 3 deletions src/nix/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ deps_public_maybe_subproject = [
]
subdir('build-utils-meson/subprojects')

subdir('build-utils-meson/threads')

subdir('build-utils-meson/export-all-symbols')
subdir('build-utils-meson/windows-version')

Expand Down Expand Up @@ -65,7 +63,7 @@ add_project_arguments(
language : 'cpp',
)

subdir('build-utils-meson/diagnostics')
subdir('build-utils-meson/common')
subdir('build-utils-meson/generate-header')

nix_sources = [config_h] + files(
Expand Down

0 comments on commit 09e989f

Please sign in to comment.