Explorar el Código

Change the format of the embedded Catch 2 header, since MSVC can't handle huge string literals

default_compile_flags
vector-of-bool hace 5 años
padre
commit
130b794841
Se han modificado 3 ficheros con 34 adiciones y 8 borrados
  1. +1
    -8
      res/catch2.hpp
  2. +11
    -0
      src/dds/catch2_embeddead.generated.cpp
  3. +22
    -0
      tools/prep-catch2.py

src/dds/catch2_embedded.cpp → res/catch2.hpp Ver fichero

@@ -1,8 +1,4 @@
#include "./catch2_embedded.hpp"

namespace dds::detail {

const char* const catch2_embedded_single_header_str = R"catch2-embedded(/*
/*
* Catch v2.10.2
* Generated: 2019-10-24 17:49:11.459934
* ----------------------------------------------------------
@@ -17473,6 +17469,3 @@ using Catch::Detail::Approx;
// end catch.hpp
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED

)catch2-embedded";

}

+ 11
- 0
src/dds/catch2_embeddead.generated.cpp
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 22
- 0
tools/prep-catch2.py Ver fichero

@@ -0,0 +1,22 @@
from pathlib import Path

ROOT = Path(__file__).absolute().parent.parent
c2_header = ROOT / 'res/catch2.hpp'

buf = c2_header.read_bytes()

chars = ', '.join(f"'\\x{b:02x}'" for b in buf)

c2_embedded = ROOT / 'src/dds/catch2_embeddead_header.cpp'
c2_embedded.write_text(f'''
#include "./catch2_embedded.hpp"

namespace dds::detail {{

static const char bytes[] = {{
{chars}, '\\x00'
}};
const char* const catch2_embedded_single_header_str = bytes;

}}
''')

Cargando…
Cancelar
Guardar