fortran vs cmake vs compiler flags
- Dominant language
- C++
- Stars
- 296
- Forks
- 66
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 1
Description
BLT `blt_add_target_compile_flags` is using `target_compile_options` - if you pass flags as a cmake string, the full string gets quoted before passed to the fortran compiler. This confuses `gfortran` if you have more than one option.
If these are passed as a cmake list, things make it to the fortran compiler correctly.
I am using `blt_append_custom_compiler_flag`, which does not seem to be creating a list.
(I am using an older blt, so maybe this has been fixed?)
Contributor guide
Research direction
Start with BLT's blt_add_target_compile_flags and blt_append_custom_compiler_flag entry points, then reproduce the behavior using CMake and gfortran with multiple compiler options. Confirm that flags passed as a CMake string are split correctly before reaching the Fortran compiler, while preserving correct handling of CMake lists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, fortran
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100