Repository navigation
build.py: optional models as a table (Model M and K unchanged) - #95
Merged
Merged
Conversation
…M and K unchanged) The runtime library's optional models are one table, OPTIONAL_MODELS: each row names the model's runtime sources, built-in files, map, the define and stand-in source of a build without it, its kernel build and its option text. --no-model-<name> options, the -DWG_NO_MODEL_<name> defines, the copied maps, the kernel builds and the extra-architecture child commands come from it. Model K's row is the former --no-model-k code; set_model_k and MODEL_K keep working. test_build_models checks model K's row against the old switch and plugs in a synthetic second optional model. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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.
The build script's
--no-model-kswitch is now a table of optional models. A further model of the runtime librarycan be switched in and out by adding a row instead of a second copy of the switch. Nothing changes for Model M or
model K: same source lists, built-in files, compiler commands, copied maps, kernel builds and options.
What changes (
clean/runner/build.py)OPTIONAL_MODELS: one row per optional model with its runtime sources, built-in files, map file, the define andstand-in source of a build without it, its kernel build function, and its option text. Model K's row points at the
existing
K_RUNTIME_SOURCES,K_EMBED_FILES,K_MAP_FILE,WG_NO_MODEL_K,no_model_k.cpp,k_build.build_deviceand the old help text.set_model(name, on)andmodel_built(name).set_model_k(on)and theMODEL_Kflag stay as names for model K(the existing scripts and tests use them).
--no-model-<name>options, the-DWG_NO_MODEL_<name>defines of the runtimecommand, the maps copied next to the library, the optional models' kernel builds, and the options passed on to the
extra-architecture child builds.
Refs #89
Tested
build.pyproduces, on main (d9c697e) and on this branch,for model K on, off and on again. It covers
RUNTIME_SOURCES,EMBED_FILES, the full runtime compiler command, themap files
build_runtimecopies, and the whole--helptext. The two outputs are identical.clean/tests/test_build_models.py(3 tests, CI runs it): model K's row is the old switch (same lists by eithername, same define, map and stand-in), and a synthetic second optional model gets its own option, define, sources and
built-in files without changing model K's or Model M's. It also checks which maps are copied with and without
model K.
test_build_models,test_no_model_k,test_build_targets,test_build_motion_define,test_build_cuid: 17 tests, OK (2 skipped: they need a--no-model-kbuild folder).Also run in the reverse order: OK.
Not tested
here.