-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1492 from pi-hole/new/embedded_lua_scripts
Embedded lua scripts into FTL
- Loading branch information
Showing
11 changed files
with
450 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ tools/macvendor.db | |
# Test Leftovers | ||
dig.log | ||
ptr.log | ||
|
||
# Compiled LUA scripts | ||
/src/lua/scripts/*.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Pi-hole: A black hole for Internet advertisements | ||
# (c) 2022 Pi-hole, LLC (https://pi-hole.net) | ||
# Network-wide ad blocking via your own hardware. | ||
# | ||
# FTL Engine | ||
# /src/lua/scripts/CMakeList.txt | ||
# | ||
# This file is copyright under the latest version of the EUPL. | ||
# Please see LICENSE file for your rights under this license. | ||
|
||
set(sources | ||
inspect.lua.hex | ||
scripts.h | ||
) | ||
|
||
# Compile files from raw/ into hex/ | ||
find_program(RESOURCE_COMPILER xxd) | ||
file(GLOB_RECURSE COMPILED_RESOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "./*.lua") | ||
foreach(INPUT_FILE ${COMPILED_RESOURCES}) | ||
set(IN ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}) | ||
set(OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}.hex) | ||
add_custom_command( | ||
OUTPUT ${INPUT_FILE}.hex | ||
COMMAND ${RESOURCE_COMPILER} -i < ${IN} > ${OUTPUT_FILE} | ||
COMMENT "Compiling ${INPUT_FILE} to binary" | ||
VERBATIM) | ||
list(APPEND COMPILED_RESOURCES ${OUTPUT_FILE}) | ||
endforeach() | ||
|
||
# Ensure target lua_scripts is build before target lua | ||
add_dependencies(lua lua_scripts) | ||
|
||
add_library(lua_scripts OBJECT ${sources}) | ||
target_compile_options(lua_scripts PRIVATE ${EXTRAWARN}) | ||
target_include_directories(lua_scripts PRIVATE ${PROJECT_SOURCE_DIR}/src) |
Oops, something went wrong.