mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 01:55:07 +00:00
Meta: Use embed_as_string_view() for stringify_gml()
This commit is contained in:
parent
abba6f7b54
commit
eab44f982a
|
@ -24,18 +24,8 @@ endfunction()
|
|||
|
||||
function(stringify_gml source output string_name)
|
||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${source})
|
||||
add_custom_command(
|
||||
OUTPUT ${output}
|
||||
COMMAND ${SerenityOS_SOURCE_DIR}/Meta/text-to-cpp-string.sh ${string_name} ${source} > ${output}.tmp
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${output}.tmp ${output}
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove ${output}.tmp
|
||||
VERBATIM
|
||||
DEPENDS ${SerenityOS_SOURCE_DIR}/Meta/text-to-cpp-string.sh
|
||||
MAIN_DEPENDENCY ${source}
|
||||
)
|
||||
get_filename_component(output_name ${output} NAME)
|
||||
add_custom_target(generate_${output_name} DEPENDS ${output})
|
||||
add_dependencies(all_generated generate_${output_name})
|
||||
embed_as_string_view(${output_name} ${source} ${output} ${string_name})
|
||||
endfunction()
|
||||
|
||||
function(compile_gml source output)
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# $1 name of the variable
|
||||
# $2 input path
|
||||
|
||||
echo "#include <AK/StringView.h>"
|
||||
echo
|
||||
echo "extern StringView $1;"
|
||||
printf "StringView %s = R\"~~~(" "$1"
|
||||
grep -v '^ *#' < "$2" | while IFS= read -r line; do
|
||||
echo "$line"
|
||||
done
|
||||
echo ")~~~\"sv;"
|
Loading…
Reference in a new issue