Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building without PCHs #303

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Allow building without PCHs #303

merged 1 commit into from
Jan 21, 2025

Conversation

arch1t3cht
Copy link
Member

PR created to test CI. Commit message below.


It seems that Aegisub used to be able to be built without precompiled headers, but this broke with the meson port since there the PCHs are needed to include acconf.h. (On the old build system(s), the feature flags were passed directly as defines to the compiler on Visual Studio, and acconf.h was forcibly included via -include acconf.h with autoconf.)

Some distributions (gentoo in particular) disable PCHs by default for meson due to various bugs, and PCHs can also be quite a headache with language servers (I ended up running an sed one-liner after every configure to replace -include-pch in my compile_commands.json with the respective -include).

Since meson doesn't seem to be able to forcibly include headers for every source file, just pass the config as a set of preprocessor defines.

Disable b_pch on most of the CI lanes to catch missing includes but keep it enabled on one of the Ubuntu lanes just in cases something breaks with PCH enabled.

It seems that Aegisub used to be able to be built without precompiled
headers, but this broke with the meson port since there the PCHs are
needed to include acconf.h. (On the old build system(s), the feature
flags were passed directly as defines to the compiler on Visual Studio,
and acconf.h was forcibly included via -include acconf.h with autoconf.)

Some distributions (gentoo in particular) disable PCHs by default for
meson due to various bugs, and PCHs can also be quite a headache with
language servers (I ended up running an sed one-liner after every
configure to replace -include-pch in my compile_commands.json with the
respective -include).

Since meson doesn't seem to be able to forcibly include headers for
every source file, just pass the config as a set of preprocessor
defines when b_pch is disabled. If it's enabled, stick to acconf.h to
not bloat the compiler command lines too much.

Disable b_pch on the Ubuntu CI lanes to catch missing includes but keep
it enabled on Windows and Mac for faster compilation (with compiling on
Windows already taking around an hour).

The added includes were mostly taken from #241
and #223.

Co-authored-by: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
Co-authored-by: Nick Sarnie <sarnex@gentoo.org>
@arch1t3cht arch1t3cht merged commit 0f268ed into master Jan 21, 2025
7 checks passed
@arch1t3cht arch1t3cht deleted the no_pch branch January 21, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant