aboutsummaryrefslogtreecommitdiff
path: root/examples/system/childexec
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-03-25 09:22:20 +0800
committerGitHub <noreply@github.com>2022-03-25 09:22:20 +0800
commit975e614b3c840e2f717adac1d1cb9cee4e5e561b (patch)
tree6584ce5b0dbe27a466c95c81fac61b0d90f627bd /examples/system/childexec
parent05d44488bd5587786f4bd0286fc0f555c79aa46a (diff)
parent45168ae43e29aa5930ee5a206475ae836078915f (diff)
downloadpsn00bsdk-975e614b3c840e2f717adac1d1cb9cee4e5e561b.tar.gz
Merge pull request #46 from spicyjpeg/psxmdec
Critical ldscript fixes, initial MDEC support and CI updates
Diffstat (limited to 'examples/system/childexec')
-rw-r--r--examples/system/childexec/CMakeLists.txt16
-rw-r--r--examples/system/childexec/child_exe.s.template6
2 files changed, 7 insertions, 15 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 f76bb3d..0000000
--- a/examples/system/childexec/child_exe.s.template
+++ /dev/null
@@ -1,6 +0,0 @@
-.section .data
-
-.global child_exe # Insert spoopypasta
-.type child_exe, @object
-child_exe:
- .incbin "${PROJECT_BINARY_DIR}/child.exe"