manifest: extend preprocess_config_t for external preprocessor support#1268
Open
ijatinydv wants to merge 1 commit into
Open
manifest: extend preprocess_config_t for external preprocessor support#1268ijatinydv wants to merge 1 commit into
ijatinydv wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now fpm silently drops any [preprocess] section that isn't cpp, there's a four-line guard in
add_config()at lines 320–324 that returns early with a warning if the name isn't "cpp". This PR removes that guard and adds the fields needed to describe an external preprocessor in fpm.toml.What changed
preprocess.f90— two things:add_config(). Any preprocessor name is now accepted.preprocess_config_t:command— the executable to invoke (e.g."fypp"). This is the activation key: a section withoutcommandstays silently ignored, so existing[preprocess.fypp]sections in the wild don't break.arguments(:)— extra CLI flags passed verbatim.output-suffix— output extension, defaults to.f90. Set to.F90for tools that emit output requiring a second CPP pass.depfile— opt-in boolean for--depfilesupport. Defaults.false.so custom tools that don't support the flag are never passed it.Also added
is_external(), returns.true.whencommandis allocated. This single check will gate all external execution in the phases that follow.Updated everything that touches fields:
check()whitelist,new_preprocess_config(),dump_to_toml,load_from_toml,preprocess_is_same,destroy,add_config, andinfo.test_manifest.f90— added two tests:preprocess-externalparses a full fypp config with all new fields and verifies a serialization roundtrip;preprocess-backward-compatverifies that a section withoutcommandleavesis_external()as.false.and produces no error.Backward compatibility
Existing
[preprocess.cpp]manifests work exactly as before. A[preprocess.fypp]section withoutcommandis still silently ignored same behavior as today.This is the manifest groundwork for the external preprocessor execution engine. The execution logic, Phase A integration in
build_model(), and target system changes come in follow up PRs. Raising this early so the schema can get feedback before the rest is built on top of it.Related: #78, #308, #469