Skip to content

Commit

Permalink
eckit::codec config file
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Aug 23, 2023
1 parent 4acadcf commit c0b6b26
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ ecbuild_add_option( FEATURE XXHASH

### Codec options

set( eckit_codec_RECORD_BEGIN "ATLAS-IO" CACHE STRING "eckit::codec record begin" )
set( eckit_codec_RECORD_END "ATLAS-IO-END" CACHE STRING "eckit::codec record end" )
set( eckit_CODEC_RECORD_BEGIN "ATLAS-IO" CACHE STRING "eckit::codec record begin" )
set( eckit_CODEC_RECORD_END "ATLAS-IO-END" CACHE STRING "eckit::codec record end" )
# also ECKIT_CODEC_STATIC_ASSERT

### Geometry options
Expand Down
3 changes: 2 additions & 1 deletion src/eckit/codec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

configure_file( eckit_codec_config.h.in eckit_codec_config.h )
configure_file( eckit_codec_config.h.in eckit_codec_config.h @ONLY )
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/eckit_codec_config.h
DESTINATION ${INSTALL_INCLUDE_DIR}/eckit
Expand All @@ -9,6 +9,7 @@ ecbuild_add_library(
TARGET eckit_codec

INSTALL_HEADERS ALL
HEADER_DESTINATION ${INSTALL_INCLUDE_DIR}/eckit/codec
PUBLIC_LIBS eckit
PUBLIC_INCLUDES
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
Expand Down
8 changes: 4 additions & 4 deletions src/eckit/codec/detail/RecordSections.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ namespace eckit::codec {
// ------------------------------------------------------------------------------------------------------------------------------------

struct RecordBegin {
FixedString<8> string{ECKIT_CODEC_RECORD_BEGIN};
FixedString<8> string{eckit_CODEC_RECORD_BEGIN};
FixedString<8> spare{"\n"};

bool valid() const { return string == ECKIT_CODEC_RECORD_BEGIN; }
bool valid() const { return string == eckit_CODEC_RECORD_BEGIN; }
std::string str() const { return string; }
};

struct RecordEnd { // 32 bytes
static constexpr size_t bytes = 32;

FixedString<1> eol{"\n"};
FixedString<12> string{ECKIT_CODEC_RECORD_END};
FixedString<12> string{eckit_CODEC_RECORD_END};
FixedString<19> padding{" \n\n\n\n"};

bool valid() const { return string == ECKIT_CODEC_RECORD_END; }
bool valid() const { return string == eckit_CODEC_RECORD_END; }
std::string str() const { return string; }
};

Expand Down
1 change: 0 additions & 1 deletion src/eckit/codec/detail/Version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
/*
* (C) Copyright 1996- ECMWF.
*
Expand Down
4 changes: 2 additions & 2 deletions src/eckit/codec/eckit_codec_config.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#define ECKIT_CODEC_RECORD_BEGIN "@eckit_codec_RECORD_BEGIN@"
#define ECKIT_CODEC_RECORD_END "@eckit_codec_RECORD_END@"
#cmakedefine eckit_CODEC_RECORD_BEGIN "@eckit_CODEC_RECORD_BEGIN@"
#cmakedefine eckit_CODEC_RECORD_END "@eckit_CODEC_RECORD_END@"

0 comments on commit c0b6b26

Please sign in to comment.