To complete this post, either of the methods below can successfully compile my project.
- All flags wrapped with "SHELL:"
set(fflags "SHELL:-qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source -O2 -debug minimal -free")
set(cflags "SHELL:-qno-opt-dynamic-align -fp-model precise -O2 -debug minimal")
add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:${fflags}>")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${cflags}>")
- Compound flags separated from single-token flags and then wrapped with "SHELL:"
set(fflags -O2 -ftz -free -traceback -qno-opt-dynamic-align "SHELL:-convert big_endian -assume byterecl -assume realloc_lhs -fp-model source -debug minimal")
set(cflags -O2 -qno-opt-dynamic-align "SHELL:-fp-model precise -debug minimal")
add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:${fflags}>")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${cflags}>")