llnl / llnl/blt

Improve the consistency of BLT's flag-related macros

Open
#305 2 comments 0 reactions 0 assignees View on GitHub
flags
Dominant language
C++
Stars
296
Forks
66
Avg merge
1h 3m
Merged PRs (30d)
1

Description

We have several macros that deal with compiler flags, but they do not consistently treat the flags or share an underlying implementation. Some of them return a CMake list, while others return a CMake string with spaces.

These should be made more consistent and should work better with each other.

### Details

* There was some effort involved in getting ``blt_add_target_link_flags`` to work with different cmake versions. This involved using CMake's ``separate_arguments`` macro to properly separate command line arguments.

* Our ``blt_append_custom_compiler_flag()`` macro returns a string with spaces, which is not directly compatible with the underlying macros that add flags to targets, e.g. CMake's ``target_compile_options()`` or blt's ``blt_add_target_compile_flags()``.

* ``blt_add_target_compile_flags`` should also take an extra parameter to indicate if the flags should be made ``PUBLIC``, ``PRIVATE`` or ``INTERFACE``, which would override the default (based on the target type).

Related issues: #181, #234, #236, #307

Contributor guide

Open the contributing guide

Research direction

Start by locating the flag-related macros, especially blt_add_target_link_flags, blt_append_custom_compiler_flag(), and blt_add_target_compile_flags. Review how CMake's separate_arguments and target_compile_options() handle flags across supported CMake versions. Done means the macros use compatible, consistent flag representations and blt_add_target_compile_flags supports PUBLIC, PRIVATE, or INTERFACE overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.