Skip to content

Commit

Permalink
fix: cmake debug target changes and update ci (#1532)
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored Jun 21, 2024
1 parent 0c77856 commit 98ea776
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/github_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
libyaml-flag: [ "", -DWITH_YAML=on ]
io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
build-type: [ "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_BUILD_TYPE=Debug" ]
container:
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
env:
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
CMAKE_FLAGS: "${{ matrix.build-type }} ${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

# add build type for debug, overrides default flags (set with $FCFLAGS, $CFLAGS)
set(CMAKE_Fortran_FLAGS_DEBUG)

# Define the CMake project
project(FMS
VERSION 2024.01.01
Expand Down Expand Up @@ -339,11 +336,8 @@ foreach(kind ${kinds})
target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}")
target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}")

string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
if (NOT build_type STREQUAL debug)
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS
"${${kind}_flags}")
endif()
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS "${${kind}_flags}")

set_target_properties(${libTgt}_f PROPERTIES Fortran_MODULE_DIRECTORY
${moduleDir})

Expand Down

0 comments on commit 98ea776

Please sign in to comment.