diff --git a/CMakeLists.txt b/CMakeLists.txt index 36a33063..bb4282c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,13 @@ ecbuild_add_executable ( # To fix this, we explicitly set the linker language to Fortran. set_target_properties (GEOSgcm.x PROPERTIES LINKER_LANGUAGE Fortran) +# Using JeMalloc will be optional, default OFF +option (USE_JEMALLOC "Use JeMalloc" OFF) +if (USE_JEMALLOC) + find_package (JeMalloc REQUIRED) + target_link_libraries (GEOSgcm.x JeMalloc::JeMalloc) +endif () + ecbuild_add_executable ( TARGET idfupd.x SOURCES idfupd.F90