[Fortran] Use INTERFACE targets for options and dependencies - #193469
Conversation
|
@petrhosek ping |
tarunprabhu
left a comment
There was a problem hiding this comment.
I have used interface modules, but I can't say that I am very comfortable with them. But this looks reasonable to me.
Just a couple of minor nits.
| if (CMAKE_Fortran_COMPILER_ID MATCHES "LLVM") | ||
| target_compile_options(fortran-compile-options INTERFACE | ||
| # Flang bug workaround: Reformating of cooked token buffer causes | ||
| # identifier to be split between lines |
There was a problem hiding this comment.
Do you know if this bug is being tracked? Just curious.
There was a problem hiding this comment.
I created #139297 once as a special case of "flang cannot process its own preprocessor output". The output without -fno-reformat looks so broken that it might just not be intended to work. Breaking lines within identifiers is just the first issue I encountered. Or maybe & is supposed to concatenate them back together in fixed form mode? I do not know. In any case, #139297 was the more pressing issue and creating another issue that I don't even know enough about could have diverted from what matters.
Co-authored-by: Tarun Prabhu <tarunprabhu@gmail.com>
|
@tarunprabhu Could you re-review this. There were significant changes since your last review.
|
tarunprabhu
left a comment
There was a problem hiding this comment.
This looks reasonable to me. Thanks.
…3469) Use CMake INTERFACE libraries to express dependencies and common build options. Using INTERFACE libraries was proposed here: llvm#171610 (comment) Since such libraries can also propagate build options use this instead of `target_compile_options`. Unfortunately this does not mean we can get rid of `flang_module_target` because it also needs to set the module output directory. --------- Co-authored-by: Tarun Prabhu <tarunprabhu@gmail.com>
Use CMake INTERFACE libraries to express dependencies and common build options. Using INTERFACE libraries was proposed here: #171610 (comment) Since such libraries can also propagate build options use this instead of `target_compile_options`. Unfortunately this does not mean we can get rid of `flang_module_target` because it also needs to set the module output directory. --------- Co-authored-by: Tarun Prabhu <tarunprabhu@gmail.com>
Use CMake INTERFACE libraries to express dependencies and common build options.
Using INTERFACE libraries was proposed here:
#171610 (comment)
Since such libraries can also propagate build options use this instead of
target_compile_options. Unfortunately this does not mean we can get rid offlang_module_targetbecause it also needs to set the module output directory.