Fix CMake integration of NMODL generation. #1554
Merged
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 code for the code-generator NMODL is itself generated from Jinja templates. This requires CMake integration to ensure it happens automatically.
The following has been changed about the integration:
The CMake code needs a list of the generated files. This list is stored in a CMake file and included. This file must exist before running
code_generator.py
to generate the NMODL code, because the command to generate the files needs to know which file it will be generating. Therefore, we split the script into two phases: one to generate the list of generated files, and another to generate the files.The list of generated files depends on the build flags. Therefore, this file (
code_generator.cmake
) can't be checked into the Git repo. Thecode_generator.cmake
is created during the configure phase, and now lives in the build directory.CMake code was lifted from
src/language/CMakeLists.txt
to the top-levelCMakeLists.txt
to avoid any scoping issues for the lists of generated files.Removed pattern of yielding tasks while creating a list tasks in favour of returning the list of tasks directly.