From 1d79059897ae35cc5af87a3afb0d5c05949ab2b3 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 14 Jun 2017 12:42:48 +0200 Subject: [PATCH] Convert license to character array. --- CMakeLists.txt | 6 +++++- cmake/templates/license.h.in | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dbc521de..e0eef4d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,11 @@ include(EthExecutableHelper) include(EthUtils) # Create license.h from LICENSE.txt and template -file(READ ${CMAKE_SOURCE_DIR}/LICENSE.txt LICENSE_TEXT) +# Converting to char array is required due to MSVC's string size limit. +file(READ ${CMAKE_SOURCE_DIR}/LICENSE.txt LICENSE_TEXT HEX) +string(REGEX MATCHALL ".." LICENSE_TEXT "${LICENSE_TEXT}") +string(REGEX REPLACE ";" ",\t0x" LICENSE_TEXT "${LICENSE_TEXT}") + configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" "license.h") include(EthOptions) diff --git a/cmake/templates/license.h.in b/cmake/templates/license.h.in index 48801347e..b254e8715 100644 --- a/cmake/templates/license.h.in +++ b/cmake/templates/license.h.in @@ -1,3 +1,5 @@ #pragma once -static char const* licenseText = R"(@LICENSE_TEXT@)"; +static char licenseText[] = { + 0x@LICENSE_TEXT@ +};