diff --git a/src/ecwam/CMakeLists.txt b/src/ecwam/CMakeLists.txt index 78c1e0868..0247da21b 100644 --- a/src/ecwam/CMakeLists.txt +++ b/src/ecwam/CMakeLists.txt @@ -455,6 +455,7 @@ ecwam_target_fortran_module_directory( ) if( HAVE_ACC ) + target_link_options( ${ecwam} INTERFACE SHELL:${OpenACC_Fortran_FLAGS} ) target_compile_options( ${ecwam} PRIVATE "-gpu=maxregcount:128" ) endif() diff --git a/src/programs/CMakeLists.txt b/src/programs/CMakeLists.txt index 53757729a..7c334b0dc 100644 --- a/src/programs/CMakeLists.txt +++ b/src/programs/CMakeLists.txt @@ -17,7 +17,7 @@ foreach( program ecbuild_add_executable( TARGET ${PROJECT_NAME}-${program} SOURCES ${program}.F90 - LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES} $<${HAVE_ACC}:OpenACC::OpenACC_Fortran> + LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES} LINKER_LANGUAGE Fortran ) ecwam_target_compile_definitions_FILENAME(${PROJECT_NAME}-${program})