From a23c15cd0160d27c3878489b3e8e8ca72411315e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 12 Mar 2020 17:19:34 +0000 Subject: [PATCH] Can disable GRIB as well --- CMakeLists.txt | 6 +++++- definitions/CMakeLists.txt | 3 +++ memfs.py | 8 +++++++- memfs/CMakeLists.txt | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98a620815..b6ce30a8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,8 +69,12 @@ ecbuild_info("Operating system=${CMAKE_SYSTEM} (${EC_OS_BITS} bits)") ############################################################################### # some variables/options of this project +ecbuild_add_option( FEATURE PRODUCT_GRIB + DESCRIPTION "Support for the product GRIB" + DEFAULT ON +) ecbuild_add_option( FEATURE PRODUCT_BUFR - DESCRIPTION "Support for BUFR" + DESCRIPTION "Support for the product BUFR" DEFAULT ON ) diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index f8779064a..85eb4e031 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -14,6 +14,9 @@ foreach( child ${children} ) if( NOT HAVE_PRODUCT_BUFR AND child STREQUAL bufr ) set( add_child 0 ) endif() + if( NOT HAVE_PRODUCT_GRIB AND child MATCHES "^grib" ) + set( add_child 0 ) + endif() if( add_child ) list( APPEND dirlist ${child} ) endif() diff --git a/memfs.py b/memfs.py index 8e29dd7f9..07d422648 100755 --- a/memfs.py +++ b/memfs.py @@ -14,7 +14,13 @@ EXCLUDED = ['grib3', 'codetables', 'taf', 'metar'] pos=1 if sys.argv[1] == '-exclude': - EXCLUDED.append(sys.argv[2]) + product = sys.argv[2] + if product == 'bufr': + EXCLUDED.append(product) + elif product == 'grib': + EXCLUDED.extend(['grib1', 'grib2']) + else: + assert False, 'Invalid product %s' % product pos = 3 dirs = [os.path.realpath(x) for x in sys.argv[pos:-1]] diff --git a/memfs/CMakeLists.txt b/memfs/CMakeLists.txt index 524b3bd3c..48da54ad3 100644 --- a/memfs/CMakeLists.txt +++ b/memfs/CMakeLists.txt @@ -1,6 +1,8 @@ set( exclude "" ) if( NOT HAVE_PRODUCT_BUFR ) set( exclude -exclude bufr ) +elseif( NOT HAVE_PRODUCT_GRIB ) + set( exclude -exclude grib ) endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/memfs.c