Skip to content

Commit

Permalink
Trigger the use of overrideable flags after initialising project
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Oct 25, 2024
1 parent 5b87f5f commit 4f3ac66
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
cache_suffix: "${{ matrix.build_type }}-${{ env.CACHE_SUFFIX }}"
recreate_cache: ${{ matrix.caching == false }}
dependencies: |
ecmwf/ecbuild
awnawab/ecbuild@feature/purge-compiler-flags
ecmwf/eccodes
ecmwf/fckit@refs/tags/0.13.0
ecmwf-ifs/fiat@refs/tags/1.4.1
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ if( NOT ECWAM_PROJECT_NAME )
endif()

string( TOUPPER ${ECWAM_PROJECT_NAME} PNAME )
set( ${PNAME}_ECBUILD_COMPILE_FLAGS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ecwam_init_flags.cmake CACHE FILEPATH "")
project( ${ECWAM_PROJECT_NAME} LANGUAGES Fortran C CXX )

include( ecwam_macros )
Expand Down
10 changes: 6 additions & 4 deletions cmake/ecwam_compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

# Capture ecbuild defaults and/or flags set by a toolchain
set( ${PNAME}_Fortran_FLAGS "${${PNAME}_Fortran_FLAGS} ${ECBUILD_Fortran_FLAGS}" )
set( ${PNAME}_Fortran_FLAGS_BIT "${${PNAME}_Fortran_FLAGS_BIT} ${ECBUILD_Fortran_FLAGS_BIT}" )
set( ${PNAME}_Fortran_FLAGS_DEBUG "${${PNAME}_Fortran_FLAGS_DEBUG} ${ECBUILD_Fortran_FLAGS_DEBUG}" )
# Trigger the use of <PNAME>_LANG_FLAGS in ecbuild
ecbuild_init_overrideable_compiler_flags(
LANGUAGES Fortran
CAPTURE_BUNDLE_FLAGS
COMPILE_FLAGS ${CMAKE_CURRENT_LIST_FILE}
)

if(CMAKE_Fortran_COMPILER_ID MATCHES "Cray")
set(autopromote_flags "-sreal64")
Expand Down
9 changes: 0 additions & 9 deletions cmake/ecwam_init_flags.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions package/bundle/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ cmake : CMAKE_LINK_DEPENDS_NO_SHARED=ON
projects :

- ecbuild :
git : https://github.com/ecmwf/ecbuild
version : master
git : https://github.com/awnawab/ecbuild.git
version : feature/purge-compiler-flags
bundle : false

- eccodes :
Expand Down

0 comments on commit 4f3ac66

Please sign in to comment.