|
From: kosmirror <kos...@us...> - 2025-08-05 01:37:02
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 5a91091e37421e9b15678dc086d111386f80fbbb (commit)
via 9eed2f87c13767ff7cd4319170590351d9032011 (commit)
via feced843b61d21e763a49076a32e2c41d630b73d (commit)
via e4cd188dfab4bff57d99af90b6dbcea1771109c6 (commit)
via fedd55333c64220d02a317c890faf5c0376c5b84 (commit)
via 8ac11fbb5c7a37a05a3a5c8e6414eefb7c0b3cec (commit)
from 1126528da063d0b81254d9a71f9fda683c1815b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5a91091e37421e9b15678dc086d111386f80fbbb
Author: Falco Girgis <gyr...@gm...>
Date: Mon Aug 4 19:06:24 2025 -0500
REALLY addressed review feedback.
commit 9eed2f87c13767ff7cd4319170590351d9032011
Author: Falco Girgis <gyr...@gm...>
Date: Mon Aug 4 19:05:20 2025 -0500
Addressed review feedback.
commit feced843b61d21e763a49076a32e2c41d630b73d
Author: Falco Girgis <gyr...@gm...>
Date: Mon Aug 4 18:57:29 2025 -0500
Addressed review feedback.
commit e4cd188dfab4bff57d99af90b6dbcea1771109c6
Author: Falco Girgis <gyr...@gm...>
Date: Mon Aug 4 15:51:30 2025 -0500
Addressed review feedback + added optional name.
commit fedd55333c64220d02a317c890faf5c0376c5b84
Author: Falco Girgis <gyr...@gm...>
Date: Sat Aug 2 16:48:28 2025 -0500
Addressed review feedback. Much cleaner now.
commit 8ac11fbb5c7a37a05a3a5c8e6414eefb7c0b3cec
Author: Falco Girgis <gyr...@gm...>
Date: Sat Aug 2 16:27:44 2025 -0500
Added kos_run_target() to CMake toolchain.
It's currently a total PITA to run a CMake project you're actively
building... you gotta go find the binary output wherever CMake puts it
by default and call dc-tool with it..
We already have a nice, convenient, standardized rule for this kind of
crap in all of our Makefiles, which you can call with "make run." It
simply uses the KOS_LOADER environment variable configured from
environ.sh.
This PR is an attempt to map this functionality to CMake as directly as
possible.
-----------------------------------------------------------------------
Summary of changes:
utils/cmake/dreamcast.cmake | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/utils/cmake/dreamcast.cmake b/utils/cmake/dreamcast.cmake
index a8f7b5a4..6c18e558 100644
--- a/utils/cmake/dreamcast.cmake
+++ b/utils/cmake/dreamcast.cmake
@@ -1,12 +1,13 @@
# Auxiliary CMake Utility Functions
# Copyright (C) 2023 Colton Pawielski
-# Copyright (C) 2024 Falco Girgis
+# Copyright (C) 2024, 2025 Falco Girgis
# Copyright (C) 2024 Paul Cercueil
#
# This file implements utilities for the following additional functionality
# which exists in the KOS Make build system:
# 1) linking to existing binaries
# 2) adding a romdisk
+# 3) running the binary using KOS_LOADER
#
# NOTE: When using the KOS CMake toolchain file, you do not need to include
# this file directly!
@@ -31,13 +32,33 @@ if(NOT DEFINED KOS_CC_BASE)
endif()
endif()
+### Adds a custom "run" target which uses $KOS_LOADER to run the given target. ###
+function(kos_run_target target)
+ # targetName is optional and defaults to "run" when not provided.
+ if(NOT ${ARGC} EQUAL 2)
+ set(runTarget run)
+ else()
+ set(runTarget ${ARGV1})
+ endif()
+
+ # Convert KOS ENV variable to semicolon-separated list of args
+ string(REPLACE " " ";" _kos_loader $ENV{KOS_LOADER})
+
+ # Create a new target which simply passes the source target to $KOS_LOADER to run
+ add_custom_target(${runTarget}
+ COMMAND ${_kos_loader};$<TARGET_FILE:${target}>
+ DEPENDS ${target}
+ USES_TERMINAL
+ )
+endfunction()
+
### Helper Function for Bin2Object ###
function(kos_bin2o inFile symbol)
# outFile is optional and defaults to the symbol name in the build directory
if(NOT ${ARGC} EQUAL 3)
set(outFile ${CMAKE_CURRENT_BINARY_DIR}/${symbol}.o)
else()
- set(outFile ${ARGN})
+ set(outFile ${ARGV2})
endif()
# Custom Command to generate romdisk object file from image
@@ -61,7 +82,7 @@ function(kos_add_romdisk target romdiskPath)
if(NOT ${ARGC} EQUAL 3)
set(romdiskName romdisk)
else()
- set(romdiskName ${ARGN})
+ set(romdiskName ${ARGV2})
endif()
file(REAL_PATH "${romdiskPath}" romdiskPath)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|