env_to_h cleaned
This commit is contained in:
@@ -42,7 +42,7 @@ target_sources(${DUSK_BINARY_TARGET_NAME}
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Defs
|
# Defs
|
||||||
add_defs(duskdefs.env duskdefs.h)
|
dusk_env_to_h(duskdefs.env duskdefs.h)
|
||||||
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME}
|
target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}"
|
DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# https://opensource.org/licenses/MIT
|
# https://opensource.org/licenses/MIT
|
||||||
|
|
||||||
add_subdirectory(run_python)
|
add_subdirectory(run_python)
|
||||||
|
add_subdirectory(env_to_h)
|
||||||
|
|
||||||
# Function that adds an asset to be compiled
|
# Function that adds an asset to be compiled
|
||||||
function(add_asset ASSET_TYPE ASSET_PATH)
|
function(add_asset ASSET_TYPE ASSET_PATH)
|
||||||
@@ -13,15 +14,4 @@ function(add_asset ASSET_TYPE ASSET_PATH)
|
|||||||
"${ASSET_TYPE}#${FULL_ASSET_PATH}#${ASSETS_ARGS}"
|
"${ASSET_TYPE}#${FULL_ASSET_PATH}#${ASSETS_ARGS}"
|
||||||
)
|
)
|
||||||
set(DUSK_ASSETS ${DUSK_ASSETS} CACHE INTERNAL ${DUSK_CACHE_TARGET})
|
set(DUSK_ASSETS ${DUSK_ASSETS} CACHE INTERNAL ${DUSK_CACHE_TARGET})
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(add_defs INPUT_PATH OUTPUT_NAME_RELATIVE)
|
|
||||||
set(DUSK_DEFS_TARGET_NAME "DUSK_DEFS_${OUTPUT_NAME_RELATIVE}")
|
|
||||||
dusk_run_python(
|
|
||||||
${DUSK_DEFS_TARGET_NAME}
|
|
||||||
tools.envtoh
|
|
||||||
--env ${INPUT_PATH}
|
|
||||||
--output ${DUSK_BUILT_ASSETS_DIR}/${OUTPUT_NAME_RELATIVE}
|
|
||||||
)
|
|
||||||
add_dependencies(${DUSK_LIBRARY_TARGET_NAME} ${DUSK_DEFS_TARGET_NAME})
|
|
||||||
endfunction()
|
endfunction()
|
||||||
15
tools/env_to_h/CMakeLists.txt
Normal file
15
tools/env_to_h/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Copyright (c) 2026 Dominic Masters
|
||||||
|
#
|
||||||
|
# This software is released under the MIT License.
|
||||||
|
# https://opensource.org/licenses/MIT
|
||||||
|
|
||||||
|
function(dusk_env_to_h INPUT_PATH OUTPUT_NAME_RELATIVE)
|
||||||
|
set(DUSK_DEFS_TARGET_NAME "DUSK_DEFS_${OUTPUT_NAME_RELATIVE}")
|
||||||
|
dusk_run_python(
|
||||||
|
${DUSK_DEFS_TARGET_NAME}
|
||||||
|
tools.env_to_h
|
||||||
|
--env ${INPUT_PATH}
|
||||||
|
--output ${DUSK_BUILT_ASSETS_DIR}/${OUTPUT_NAME_RELATIVE}
|
||||||
|
)
|
||||||
|
add_dependencies(${DUSK_LIBRARY_TARGET_NAME} ${DUSK_DEFS_TARGET_NAME})
|
||||||
|
endfunction()
|
||||||
Reference in New Issue
Block a user