Skip to content
New issue

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

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

Already on GitHub? # to your account

CMake Modernization: consolidate add library macros, patch targets, parallel options #20040

Conversation

biagas
Copy link
Contributor

@biagas biagas commented Nov 13, 2024

Description

Started down the road of updating creating visit_add_executable macro and updating CMakeLists as necessary, ran into a lot of duplication in regards to parallel settings, so decided to try to consolidate all the logic a bit better. This is the result of that effort. The actual executable changes will come later.

Added visit_patch_target to add additional settings to a target.
Added visit_patch_parallel_target which adds all the parallel flags/includes/links to a parallel target. Can be used for a library or an executable.

Modified visit_add_parallel_library to call visit_patch_parallel_target.
Modified the current PARALLEL settings to accommodate changes needed for the new. The old-style will eventually disappear.

Updated some libraries to utilize visit_patch_target.

Type of change

  • [ ] Bug fix
  • [ ] New feature
  • [ ] Documentation update
  • Other

CMake modernization.

Checklist:

  • I have commented my code where applicable.
  • [ ] I have updated the release notes.
  • [ ] I have made corresponding changes to the documentation.
  • [ ] I have added debugging support to my changes.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have confirmed new and existing unit tests pass locally with my changes.
  • [ ] I have added new baselines for any new tests to the repo.
  • [ ] I have NOT made any changes to protocol or public interfaces in an RC branch.

Added `DO_PARALLEL` option to visit_add_libary, indicating the library should be considered parallel.
Added `SKIP_INSTALL` option to visit_add_library indicating the library isn't to be installed.
Added `visit_patch_parallel_target` which adds all the parallel flags, defines, includes, libs, etc to a parallel target.
Added `visit_patch_target` to add SOURCES, INCLUDES, DEFINES, etc to an already created target.
…_PARALLEL.

Use visit_patch_target where feasible.
It now calls visit_add_library, then visit_patch_parallel_target.
set_target_properties(engine_par PROPERTIES OUTPUT_NAME enginelib_par)
visit_patch_target(NAME engine_par OUTPUT_NAME enginelib_par)
else()
# This keeps comm's exceptions visible when using -fvisibility=hidden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a curiosity...why is keeping comm's exceptions visible needed/important?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, it was added when we moved to using CMake for the build system. Perhaps there was similar in the autoconf way of doing things way back when?

@biagas biagas merged commit 7a76dd0 into task/biagas/cmake_modernization_with_blt Jan 6, 2025
1 of 2 checks passed
@biagas biagas deleted the task/biagas/consolidate_add_library_macros branch January 6, 2025 20:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants