From: Maksym Mamontov Date: Tue, 7 Jan 2020 20:05:20 +0000 (+0200) Subject: Fix sgauth build (css embedding). X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/43d5190f7771063a5377e087b853421ceefae809?ds=inline Fix sgauth build (css embedding). --- diff --git a/sgauth/CMakeLists.txt b/sgauth/CMakeLists.txt index fc41d499..1c346b79 100644 --- a/sgauth/CMakeLists.txt +++ b/sgauth/CMakeLists.txt @@ -3,6 +3,11 @@ set ( CPP_FILES main.cpp settings_impl.cpp web.cpp ) set ( THREADS_PREFER_PTHREAD_FLAG ON ) find_package ( Threads REQUIRED ) +file ( READ sgauth.css CSS_DATA ) +configure_file ( css.h.in css.h ESCAPE_QUOTES @ONLY ) + +set ( CMAKE_INCLUDE_CURRENT_DIR ON ) + add_executable ( sgauth ${CPP_FILES} ) target_link_libraries ( sgauth conffiles ia crypto common Threads::Threads ) diff --git a/sgauth/make_css.sh b/sgauth/make_css.sh deleted file mode 100755 index b4de011e..00000000 --- a/sgauth/make_css.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -OUT_FILE=css.h - - -echo "const char * css =" > $OUT_FILE -echo "\"/*------*/\\\\n\"" >> $OUT_FILE -sed -e 's/$/\\n"/g' -e 's/^/"/g' sgauth.css >> $OUT_FILE -echo ";" >> $OUT_FILE - diff --git a/sgauth/web.cpp b/sgauth/web.cpp index 8c23482b..a162acc4 100644 --- a/sgauth/web.cpp +++ b/sgauth/web.cpp @@ -426,7 +426,7 @@ const char * replyHeader = const char * replyFooter= "\n\n"; send(outerSocket, replyHeader, strlen(replyHeader), 0); -send(outerSocket, css, strlen(css), 0); +send(outerSocket, SGAuth::css, strlen(SGAuth::css), 0); send(outerSocket, replyFooter, strlen(replyFooter), 0); return 0;