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)
All checks were successful
Run tests / Run tests (push) Successful in 7m52s
All checks were successful
Run tests / Run tests (push) Successful in 7m52s
This commit is contained in:
parent
8f56ae11b5
commit
a0a1e18162
1 changed files with 11 additions and 3 deletions
|
|
@ -207,15 +207,15 @@ function(psemek_add_winrc target path)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(psemek_package_files target)
|
function(psemek_package_files_impl target as_resources)
|
||||||
if(PSEMEK_PACKAGE_MODE)
|
if(PSEMEK_PACKAGE_MODE)
|
||||||
if(PSEMEK_PACKAGE_TARGET)
|
if(PSEMEK_PACKAGE_TARGET)
|
||||||
if(PSEMEK_PLATFORM_ANDROID)
|
if(PSEMEK_PLATFORM_ANDROID AND as_resources)
|
||||||
add_custom_command(TARGET ${target} POST_BUILD
|
add_custom_command(TARGET ${target} POST_BUILD
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||||
COMMAND ${PSEMEK_COPY_FILES} ${ARGN}
|
COMMAND ${PSEMEK_COPY_FILES} ${ARGN}
|
||||||
)
|
)
|
||||||
elseif(PSEMEK_PLATFORM_WEB)
|
elseif(PSEMEK_PLATFORM_WEB AND as_resources)
|
||||||
foreach(_FILE IN LISTS ARGN)
|
foreach(_FILE IN LISTS ARGN)
|
||||||
target_link_options(${target} PRIVATE
|
target_link_options(${target} PRIVATE
|
||||||
"--preload-file=${CMAKE_CURRENT_LIST_DIR}/${_FILE}@/resources/${_FILE}"
|
"--preload-file=${CMAKE_CURRENT_LIST_DIR}/${_FILE}@/resources/${_FILE}"
|
||||||
|
|
@ -244,3 +244,11 @@ function(psemek_package_files target)
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
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