aboutsummaryrefslogtreecommitdiff
path: root/examples/system
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-02-20 20:55:27 +0100
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-02-20 23:10:19 +0100
commita2da2debfde1d44338d203aa4d56e485c4bb16ae (patch)
treebcce13d2c63acfe4d9b1d72c1887130b29bb098f /examples/system
parent72db767f5a5bdb958bb11bcb6fe6b9b332a2b195 (diff)
downloadpsn00bsdk-a2da2debfde1d44338d203aa4d56e485c4bb16ae.tar.gz
Add psn00bsdk_target_incbin() CMake function
Diffstat (limited to 'examples/system')
-rw-r--r--examples/system/childexec/CMakeLists.txt16
-rw-r--r--examples/system/childexec/child_exe.s.template7
2 files changed, 7 insertions, 16 deletions
diff --git a/examples/system/childexec/CMakeLists.txt b/examples/system/childexec/CMakeLists.txt
index ca0c110..b781dea 100644
--- a/examples/system/childexec/CMakeLists.txt
+++ b/examples/system/childexec/CMakeLists.txt
@@ -11,18 +11,17 @@ project(
HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
)
-configure_file(child_exe.s.template child_exe.s)
-
file(GLOB _sources *.c)
file(GLOB _child_sources child/*.c)
-psn00bsdk_add_executable(
- parent STATIC
- ${_sources}
- ${PROJECT_BINARY_DIR}/child_exe.s
-)
+psn00bsdk_add_executable(parent STATIC ${_sources})
psn00bsdk_add_executable(child STATIC ${_child_sources})
#psn00bsdk_add_cd_image(childexec_iso childexec iso.xml DEPENDS parent)
+psn00bsdk_target_incbin(
+ parent PRIVATE child_exe
+ ${PROJECT_BINARY_DIR}/child.exe
+)
+
# Relocate the child executable to a non-default address to prevent it from
# overlapping with the main one at 0x80010000.
# NOTE: child executables are not position-independent and can't be relocated
@@ -30,8 +29,7 @@ psn00bsdk_add_executable(child STATIC ${_child_sources})
# dynamically-allocated buffer), consider using a DLL instead.
target_link_options(child PRIVATE -Ttext=0x80030000)
-# Make sure the child executable is built before the parent (so it can be
-# embedded via child_exe.s).
+# Make sure the child executable is built before the parent.
add_dependencies(parent child)
install(FILES ${PROJECT_BINARY_DIR}/parent.exe TYPE BIN)
diff --git a/examples/system/childexec/child_exe.s.template b/examples/system/childexec/child_exe.s.template
deleted file mode 100644
index 31e7c49..0000000
--- a/examples/system/childexec/child_exe.s.template
+++ /dev/null
@@ -1,7 +0,0 @@
-.section .data
-
-.global child_exe # Insert spoopypasta
-.type child_exe, @object
-child_exe:
- .balign 4
- .incbin "${PROJECT_BINARY_DIR}/child.exe"