]> granicus.if.org Git - graphviz/commitdiff
common: make awk crlf agnostic when generating svgcolor_lib
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Thu, 12 Aug 2021 19:57:44 +0000 (21:57 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 8 Sep 2021 16:35:34 +0000 (18:35 +0200)
Fixes errors like this with Cygwin in a crlf environment with
SHELLOPTS=igncr:

/cygdrive/c/Users/magja/graphviz/build/lib/common/common/colortbl.h:1524:2: error: missing terminating " character
 1524 | {"/svg/ ",0,255,255,255,0,0,0},
      |  ^~~~~~

Although not shown in the error message, this line actually contained
a carriage return after /svg/:

{"/svg/\r",0,255,255,255,0,0,0},

lib/common/CMakeLists.txt

index 7a668866e44f88e8835e0c69b64a50aa6d837f41..144c442ae25f90512611833a71efab686f557864 100644 (file)
@@ -6,7 +6,7 @@ add_definitions(-DGVC_EXPORTS -D_BLD_gvc=1)
 add_custom_command(
     OUTPUT svgcolor_lib
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/svgcolor_names ${TOP_SOURCE_DIR}/awk/svgcolor.awk
-    COMMAND ${AWK_EXECUTABLE} -f ${TOP_SOURCE_DIR}/awk/svgcolor.awk
+    COMMAND ${AWK_EXECUTABLE} -v RS="\\r*\\n" -f ${TOP_SOURCE_DIR}/awk/svgcolor.awk
             ${CMAKE_CURRENT_SOURCE_DIR}/svgcolor_names > ${CMAKE_CURRENT_BINARY_DIR}/svgcolor_lib
 )
 add_custom_command(