From c18b368cc424eefa4da82976bfcd232fe9f6b08d Mon Sep 17 00:00:00 2001 From: Cheng Da Date: Mon, 14 Nov 2022 13:15:01 -0500 Subject: [PATCH] Fix CMakeLists.txt of NCEP_bufr for gnu compiler Add definition `-DDYNAMIC_ALLOCATION` for GNU C compiler when compiling NCEP_bufr --- NCEP_bufr/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NCEP_bufr/CMakeLists.txt b/NCEP_bufr/CMakeLists.txt index 771e00c..6a98484 100644 --- a/NCEP_bufr/CMakeLists.txt +++ b/NCEP_bufr/CMakeLists.txt @@ -375,7 +375,11 @@ if (INTEGER_KIND STREQUAL "i8") endif() -target_compile_definitions (${this} PRIVATE $<$:STATIC_ALLOCATION>) +if (CMAKE_C_COMPILER_ID MATCHES Intel) + target_compile_definitions (${this} PRIVATE $<$:STATIC_ALLOCATION>) +elseif (CMAKE_C_COMPILER_ID MATCHES "GNU") + target_compile_definitions (${this} PRIVATE $<$:DYNAMIC_ALLOCATION>) +endif () target_compile_definitions (${this} PRIVATE $<$:MAXNC=600>) target_compile_definitions (${this} PRIVATE $<$:MXNAF=3>) target_compile_definitions (${this} PRIVATE $<$:UNDERSCORE>)