Skip to content

Commit aa2573e

Browse files
committed
Support options for call rescompiler in CMake
Support options for call rescompiler in CMake commit_hash:8110f08c01093f7c7186effee493f2c269031868
1 parent 96fe69b commit aa2573e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

build/export_generators/cmake/cmake/common.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ endfunction()
193193
function(resources Tgt Output)
194194
set(opts "")
195195
set(oneval_args "")
196-
set(multival_args INPUTS KEYS)
196+
set(multival_args INPUTS KEYS OPTS)
197197
cmake_parse_arguments(RESOURCE_ARGS
198198
"${opts}"
199199
"${oneval_args}"
@@ -212,12 +212,20 @@ function(resources Tgt Output)
212212
list(APPEND ResourcesList ${Input})
213213
list(APPEND ResourcesList ${Key})
214214
endforeach()
215+
list(LENGTH RESOURCE_ARGS_OPTS OptsCount)
216+
if (${OptsCount} GREATER 0)
217+
math(EXPR ListsMaxIdx "${OptsCount} - 1")
218+
foreach(Idx RANGE ${ListsMaxIdx})
219+
list(GET RESOURCE_ARGS_OPTS ${Idx} Opt)
220+
list(APPEND OptsList ${Opt})
221+
endforeach()
222+
endif()
215223

216224
get_built_tool_path(rescompiler_bin rescompiler_dependency tools/rescompiler/bin rescompiler)
217225

218226
add_custom_command(
219227
OUTPUT ${Output}
220-
COMMAND ${rescompiler_bin} ${Output} ${ResourcesList}
228+
COMMAND ${rescompiler_bin} ${Output} ${ResourcesList} ${OptsList}
221229
DEPENDS ${RESOURCE_ARGS_INPUTS} ${rescompiler_dependency}
222230
)
223231
endfunction()

build/ymake.core.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ macro CHECK_DEPENDENT_DIRS(TYPE, ALL?"UNUSED":"", PEERDIRS?"PEERDIRS":"ALL", RES
467467
SET_APPEND(CHECK_DEPENDENT_DIRS_TYPES $TYPE)
468468
}
469469

470-
macro _RESOURCE_SEM(INPUTS[], KEYS[]) {
470+
macro _RESOURCE_SEM(INPUTS[], KEYS[], OPTS[]) {
471471
SET(RESOURCE_OUTPUT ${hash:INPUTS}.cpp)
472-
.SEM=target_macroses-ITEM && target_macroses-macro resources && target_macroses-args ${output;global:RESOURCE_OUTPUT} INPUTS ${input:INPUTS} KEYS $KEYS ${hide;tool:"tools/rescompiler/bin"}
472+
.SEM=target_macroses-ITEM && target_macroses-macro resources && target_macroses-args ${output;global:RESOURCE_OUTPUT} INPUTS ${input:INPUTS} KEYS $KEYS OPTS $OPTS ${hide;tool:"tools/rescompiler/bin"}
473473
}
474474

475475
# tag:built-in

0 commit comments

Comments
 (0)