diff --git a/misc/pre-commit.nix b/misc/pre-commit.nix index ed2b152a3..4f54141b3 100644 --- a/misc/pre-commit.nix +++ b/misc/pre-commit.nix @@ -87,11 +87,12 @@ pre-commit-run { "file" "header" ]; - # generated files; these will never actually be seen by this - # check, and are left here as documentation excludes = [ - "(parser|lexer)-tab\\.hh$" - "\\.gen\\.hh$" + ''^src/pch/.*$'' + # generated files; these will never actually be seen by this + # check, and are left here as documentation + ''(parser|lexer)-tab\.hh$'' + ''\.gen\.hh$'' ]; entry = lib.getExe pkgs.check-headers; }; diff --git a/package.nix b/package.nix index 283a590c1..43b709023 100644 --- a/package.nix +++ b/package.nix @@ -169,7 +169,6 @@ stdenv.mkDerivation (finalAttrs: { ./boehmgc-coroutine-sp-fallback.diff ./doc ./misc - ./precompiled-headers.h ./src ./COPYING ] diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build index 4da1b496b..4dc0714c8 100644 --- a/src/libcmd/meson.build +++ b/src/libcmd/meson.build @@ -54,6 +54,7 @@ libcmd = library( nlohmann_json, lix_doc ], + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build index fda6fde2c..9a18c7ab3 100644 --- a/src/libexpr/meson.build +++ b/src/libexpr/meson.build @@ -145,6 +145,7 @@ libexpr = library( include_directories : [ '../libmain', ], + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index dbb85b84c..365bcd4a7 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -30,6 +30,7 @@ libfetchers = library( liblixutil, nlohmann_json, ], + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/src/libmain/meson.build b/src/libmain/meson.build index b17247a9d..075aa83b2 100644 --- a/src/libmain/meson.build +++ b/src/libmain/meson.build @@ -20,6 +20,7 @@ libmain = library( liblixutil, liblixstore, ], + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/src/libstore/meson.build b/src/libstore/meson.build index f776e9621..65ecacc20 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -220,6 +220,7 @@ libstore = library( nlohmann_json, ], cpp_args : cpp_args, + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/src/libutil/meson.build b/src/libutil/meson.build index 96450fbe2..cfdd0e52c 100644 --- a/src/libutil/meson.build +++ b/src/libutil/meson.build @@ -129,6 +129,7 @@ libutil = library( openssl, nlohmann_json, ], + cpp_pch : ['../pch/precompiled-headers.hh'], implicit_include_directories : true, install : true, ) diff --git a/src/nix/meson.build b/src/nix/meson.build index e41399b5d..45303641f 100644 --- a/src/nix/meson.build +++ b/src/nix/meson.build @@ -89,6 +89,7 @@ nix = executable( boehm, nlohmann_json, ], + cpp_pch : ['../pch/precompiled-headers.hh'], install : true, # FIXME(Qyriad): is this right? install_rpath : libdir, diff --git a/precompiled-headers.h b/src/pch/precompiled-headers.hh similarity index 100% rename from precompiled-headers.h rename to src/pch/precompiled-headers.hh diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 35a11a5d3..d8d4a00d1 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -68,6 +68,7 @@ libutil_tester = executable( liblixutil_test_support, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -102,6 +103,7 @@ libstore_test_support = library( include_directories : include_directories( 'libstore-support', ), + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) liblixstore_test_support = declare_dependency( include_directories : include_directories('libstore-support'), @@ -135,6 +137,7 @@ libstore_tester = executable( gtest, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -166,6 +169,7 @@ libexpr_test_support = library( include_directories : include_directories( 'libexpr-support', ), + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) liblixexpr_test_support = declare_dependency( include_directories : include_directories('libexpr-support'), @@ -199,6 +203,7 @@ libexpr_tester = executable( gtest, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -225,6 +230,7 @@ libcmd_tester = executable( gtest, boost, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test(