Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit f5c6c89

Browse files
committed
cmake best practices compiler flags
1 parent e8d1586 commit f5c6c89

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: ci
22

3+
env:
4+
CMAKE_BUILD_TYPE: Release
5+
36
on:
47
push:
58
paths-ignore:

CMakeLists.txt

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
cmake_minimum_required(VERSION 3.1)
2-
if(NOT CMAKE_BUILD_TYPE)
3-
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release")
4-
endif()
5-
project(iri90 Fortran)
1+
cmake_minimum_required(VERSION 3.14...3.21)
2+
3+
project(iri90 LANGUAGES Fortran)
64

75
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
8-
set(FFLAGS -std=legacy)
6+
add_compile_options(-std=legacy)
97
endif()
108

119
add_subdirectory(src)
1210

1311
# testiri90 is an interactive program, not for CI
1412
add_executable(testiri90 src/iritest.for)
15-
target_link_libraries(testiri90 iri90)
13+
target_link_libraries(testiri90 PRIVATE iri90)
1614

1715
add_executable(iri90_driver src/iri90.f src/iri90_driver.f90)

src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
add_library(iri90 iridreg.for iritec.for igrf.for cira.for irifun.for iriflip.for irisub.for)
2-
target_compile_options(iri90 PRIVATE ${FFLAGS})

0 commit comments

Comments
 (0)