CMakeLists.txt: remove bootstrap script, use executable directly; move its functionalities to twn tooling
This commit is contained in:
@ -275,7 +275,7 @@ function(use_townengine target sources output_directory data_dir)
|
||||
endif()
|
||||
|
||||
set_target_properties(${target}_app PROPERTIES
|
||||
OUTPUT_NAME launcher
|
||||
OUTPUT_NAME ${target}
|
||||
LIBRARY_OUTPUT_DIRECTORY ${output_directory}
|
||||
RUNTIME_OUTPUT_DIRECTORY ${output_directory})
|
||||
|
||||
@ -306,47 +306,6 @@ function(use_townengine target sources output_directory data_dir)
|
||||
COMMAND_EXPAND_LISTS)
|
||||
endif()
|
||||
|
||||
# bootstrapping scripts are used to setup the expected state for an application
|
||||
set(TWN_BOOTSTRAP_EXEC_ARGS
|
||||
"$<IF:$<BOOL:${TWN_ARCHIVE_DATA}>,--data-dir ./data.${PACKAGE_EXTENSION},--data-dir ${data_dir}>")
|
||||
|
||||
# todo: generate by python script instead
|
||||
# todo: handle the case where no numerical trace exists
|
||||
string(JOIN "\n" TWN_BOOTSTRAP_SH
|
||||
"#!/bin/env sh"
|
||||
"cd \"$(dirname \"$0\")\""
|
||||
"export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:./\""
|
||||
"if [ \"\$1\" = \"gdb\" ]; then"
|
||||
" unset DEBUGINFOD_URLS"
|
||||
" gdb -ex run --args ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}"
|
||||
"elif [ \"\$1\" = \"apitrace-take\" ]; then"
|
||||
" export ASAN_OPTIONS=verify_asan_link_order=0"
|
||||
" export LD_PRELOAD=\"/usr/lib/libubsan.so.1 /usr/lib/apitrace/wrappers/glxtrace.so \$LD_PRELOAD\""
|
||||
" ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}"
|
||||
"elif [ \"\$1\" = \"apitrace-use\" ]; then"
|
||||
" traces=( launcher.*.trace )"
|
||||
" trace=\${traces[-1]}"
|
||||
" qapitrace \${trace}"
|
||||
"else"
|
||||
" ./launcher ${TWN_BOOTSTRAP_EXEC_ARGS}"
|
||||
"fi"
|
||||
"")
|
||||
|
||||
FILE(GENERATE OUTPUT ${output_directory}/${target}
|
||||
CONTENT "${TWN_BOOTSTRAP_SH}"
|
||||
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
|
||||
|
||||
if(WIN32)
|
||||
string(JOIN "\n" TWN_BOOTSTRAP_BAT
|
||||
"pushd \"%~dp0\""
|
||||
"launcher ${TWN_BOOTSTRAP_EXEC_ARGS}"
|
||||
"")
|
||||
|
||||
FILE(GENERATE OUTPUT ${output_directory}/${target}.bat
|
||||
CONTENT "${TWN_BOOTSTRAP_BAT}"
|
||||
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
|
||||
endif()
|
||||
|
||||
if (TWN_ARCHIVE_DATA)
|
||||
# zip up assets
|
||||
add_custom_target(archive-data ALL
|
||||
|
Reference in New Issue
Block a user