Split package_files and package_resources: the former simply adds to the zip archive, the latter uses platform-specific resources packaging (on web and android)
Some checks failed
Run tests / Run tests (push) Has been cancelled
Some checks failed
Run tests / Run tests (push) Has been cancelled
This commit is contained in:
parent
34c1a92f0b
commit
0e2042879f
1 changed files with 11 additions and 3 deletions
|
|
@ -207,15 +207,15 @@ function(psemek_add_winrc target path)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(psemek_package_files target)
|
||||
function(psemek_package_files_impl target as_resources)
|
||||
if(PSEMEK_PACKAGE_MODE)
|
||||
if(PSEMEK_PACKAGE_TARGET)
|
||||
if(PSEMEK_PLATFORM_ANDROID)
|
||||
if(PSEMEK_PLATFORM_ANDROID AND as_resources)
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
COMMAND ${PSEMEK_COPY_FILES} ${ARGN}
|
||||
)
|
||||
elseif(PSEMEK_PLATFORM_WEB)
|
||||
elseif(PSEMEK_PLATFORM_WEB AND as_resources)
|
||||
foreach(_FILE IN LISTS ARGN)
|
||||
target_link_options(${target} PRIVATE
|
||||
"--preload-file=${CMAKE_CURRENT_LIST_DIR}/${_FILE}@/resources/${_FILE}"
|
||||
|
|
@ -244,3 +244,11 @@ function(psemek_package_files target)
|
|||
endforeach()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(psemek_package_files target)
|
||||
psemek_package_files_impl(${target} FALSE ${ARGN})
|
||||
endfunction()
|
||||
|
||||
function(psemek_package_resources target)
|
||||
psemek_package_files_impl(${target} TRUE ${ARGN})
|
||||
endfunction()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue