mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
Meta: Use embed_as_string_view() for stringify_gml()
This commit is contained in:
parent
abba6f7b54
commit
eab44f982a
2 changed files with 1 additions and 23 deletions
|
@ -24,18 +24,8 @@ endfunction()
|
||||||
|
|
||||||
function(stringify_gml source output string_name)
|
function(stringify_gml source output string_name)
|
||||||
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${source})
|
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)
|
get_filename_component(output_name ${output} NAME)
|
||||||
add_custom_target(generate_${output_name} DEPENDS ${output})
|
embed_as_string_view(${output_name} ${source} ${output} ${string_name})
|
||||||
add_dependencies(all_generated generate_${output_name})
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(compile_gml source output)
|
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…
Add table
Add a link
Reference in a new issue