From e42b4cc75f90af2b8ad338a0c113634408551e88 Mon Sep 17 00:00:00 2001 From: cladmi Date: Fri, 27 Sep 2019 18:50:48 +0200 Subject: [PATCH] dist/tools/cmake: handle strings with \" CMake quoted strings do not accept having \ or " inside. So use the "bracket argument" format. I migrated all variables to use this format. Migrate to 'printf' to not rely on having \" inside the string everywhere. This prepares for having macros defined in the CFLAGS again. --- .../cmake/generate-xcompile-toolchain.sh | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/dist/tools/cmake/generate-xcompile-toolchain.sh b/dist/tools/cmake/generate-xcompile-toolchain.sh index 55f4af8c45..e723b8205d 100755 --- a/dist/tools/cmake/generate-xcompile-toolchain.sh +++ b/dist/tools/cmake/generate-xcompile-toolchain.sh @@ -1,17 +1,31 @@ #!/usr/bin/env sh -echo "SET(CMAKE_SYSTEM_NAME Generic)" -echo "SET(CMAKE_SYSTEM_VERSION 1)" + +# When setting variables, use the 'bracket argument' format to allow having \" +# inside the string. Which is not supported by quoted arguments +# https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-argument +# +# bracket_argument ::= bracket_open bracket_content bracket_close +# bracket_open ::= '[' '='* '[' +# bracket_content ::=