aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-14 20:47:09 +0800
committerGitHub <noreply@github.com>2017-06-14 20:47:09 +0800
commit0b99c81f8536aa7888f26ac349ab233825350efc (patch)
tree73b169932d63eecef7d28ff68d11d785768e5be5
parent21aafaa70439e41da1c9eb6b37d08707d90b35f0 (diff)
parent1ce949519dabd252c553bf958cb3d7a2cf3ecb26 (diff)
downloaddexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar.gz
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar.bz2
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar.lz
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar.xz
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.tar.zst
dexon-solidity-0b99c81f8536aa7888f26ac349ab233825350efc.zip
Merge pull request #2393 from ethereum/license_char_array
Convert license to character array.
-rw-r--r--CMakeLists.txt7
-rw-r--r--cmake/templates/license.h.in4
2 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2dbc521d..d6ed6643 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,12 @@ 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 ";" ",\n\t0x" LICENSE_TEXT "${LICENSE_TEXT}")
+set(LICENSE_TEXT "0x${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 48801347..ccc61c99 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 const licenseText[] = {
+ @LICENSE_TEXT@
+};