From 1056ef500d201e35fc1ff5530f842cf69765eff3 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 20 Aug 2024 15:08:59 -0500 Subject: [PATCH] Update main CMakeLists.txt to set 'C' compiler options. Fixes #879. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95dc62e87..4e3d764c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,10 +86,14 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -fcheck=all") endif() -if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback") - set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0") + if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_C_FLAGS_RELEASE "-O2") + else() + set(CMAKE_C_FLAGS_RELEASE "-O1") + endif() endif() # Find packages.