From 34b57fa00b25db8e50f6871e521d40ee414d93c3 Mon Sep 17 00:00:00 2001
From: Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>
Date: Tue, 10 Dec 2024 18:47:31 +0100
Subject: [PATCH] cmake: simplify compile option assignment

---
 CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 077e3180..5f03d30a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,10 +18,10 @@ option(BUILD_DOCUMENTATION "Build documentation" OFF)
 option(MTIME_ENABLE_FORTRAN_HL "Enable the high-level Fortran interface" ON)
 
 # Set line limit to none for GNU compiler (default is 132) to enable long
-# __FILE__ macro
-if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
-  add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-ffree-line-length-none>)
-endif()
+# __FILE__ macro:
+add_compile_options(
+  $<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-ffree-line-length-none>
+)
 
 include(GNUInstallDirs)
 
-- 
GitLab