update rgbds 1.0.3 - #151
Conversation
apply fixes for build: - createSymbol(intern(name)) - ZLIB::ZLIB and PNG::PNG - temporarily override execute_process for passing rgbds version correctly
|
instead hacking execute_process it would be nice if rgbds would not use git for obtaining version if fx there is some CMAKE var already |
| # we need only those targets from rgbds | ||
| set(RGBDS_TARGETS rgbasm rgblink rgbfix) | ||
|
|
||
| # no git for you rgbds |
There was a problem hiding this comment.
the problem is that current build takes version from tag ... but ... with our build ${CMAKE_SOURCE_DIR}
points to rgbds-live not rgbds ...
this change forces cmake to land in this path https://github.com/gbdev/rgbds/blob/v1.0.3/CMakeLists.txt#L100C5-L100C96
There was a problem hiding this comment.
It seems simpler to modify it to be CMAKE_CURRENT_SOURCE_DIR?
There was a problem hiding this comment.
- i belive i tried it
- there will be "-dirty" problem still
There was a problem hiding this comment.
yeap
-- Determining RGBDS version from Git history
-- Determining RGBDS version from Git history - 9d3bf94-dirty
CMake Warning at rgbds/CMakeLists.txt:109 (message):
No `v*` Git tag reachable; falling back
# # no git for you rgbds
# # this hack will stop rgbds build from obtain rgbds-live version from git
# # it will be passed via BUILD_VERSION_STRING
# macro(execute_process)
# if("${ARGV}" MATCHES "describe")
# set(result 1)
# else()
# _execute_process(${ARGV})
# endif()
# endmacro()
set(CMAKE_CURRENT_SOURCE_DIR_BCKUP ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rgbds)
# and we will put em into this target
add_custom_target(rgbds)
# importing rgbds
add_subdirectory(rgbds EXCLUDE_FROM_ALL)
# restore execute_process
macro(execute_process)
_execute_process(${ARGV})
endmacro()
# target specific configuration for rgbds
foreach(TGT ${RGBDS_TARGETS})
if(TARGET ${TGT})
set_target_properties(${TGT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${RGBDS_LIVE_OUT_DIR}")
if("${TGT}" STREQUAL "rgbasm")
set(EXP_NAME "createRgbAsm")
elseif("${TGT}" STREQUAL "rgblink")
set(EXP_NAME "createRgbLink")
elseif("${TGT}" STREQUAL "rgbfix")
set(EXP_NAME "createRgbFix")
endif()
target_compile_definitions(${TGT} PRIVATE BUILD_VERSION_STRING="${RGBDS_VERSION_FROM_GIT}")
target_link_options(${TGT} PRIVATE
"-sEXPORT_NAME=${EXP_NAME}"
"-sEXPORTED_RUNTIME_METHODS=['FS']"
)
add_dependencies(rgbds ${TGT})
endif()
endforeach()
add_dependencies(rgbds_live rgbds)
set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR_BCKUP})still not working
There was a problem hiding this comment.
i've tried with
set(CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rgbds" CACHE PATH "" FORCE)also with CMAKE_SOURCE_DIR ... it doesn't work
There was a problem hiding this comment.
... it would be so much easier with gbdev/rgbds#1604
There was a problem hiding this comment.
set(CMAKE_DISABLE_FIND_PACKAGE_Git ON)
add_subdirectory(rgbds EXCLUDE_FROM_ALL)
unset(CMAKE_DISABLE_FIND_PACKAGE_Git)less hacky
There was a problem hiding this comment.
... but only if we do no use
find_program(RGBDS_LIVE_GIT NAMES git)
if(RGBDS_LIVE_GIT)instead
find_package(Git REQUIRED)There was a problem hiding this comment.
1.0.3 incorporates gbdev/rgbds@d5033a2bd, which does use find_package(Git). Either way, RGBDS needs a few build system fixes/improvements.
There was a problem hiding this comment.
I'm not sure were are we going here ...
- adding patch is bad idea ... you change the cmake script and patch will stop working (that's why we are here - not build script but changes in source and patch incompatibility)
- i've provied solution and i've tested "modify it to be CMAKE_CURRENT_SOURCE_DIR" - it is not working
|
only caveat with latest solution is when we start tagging this repo with "vXXXX" |
|
for summary, I see 3 solutions:
|
Inspired by #151, but avoiding `CACHE FORCE`, and using the newer flag introduced in Emscripten 3.1.54 (2024). Thanks for the reference! Co-authored-by: SelvinPL <przemek.sulikowski@gmail.com>
* Handle the patching of subprojects in a more debuggable way Previously, if the patch failed to apply *for any reason*, we would assume it was already applied. Additionally, some of the provided options were sloppy and turn out not to be necessary at this point anyway. Finally, we now immediately abort configuring if any of the patches fail to apply, preventing any spurious errors that our patches may have been meant to avoid. * Re-run CMake automatically if any patch file is changed * Bridge Emscripten's ports system better Inspired by #151, but avoiding `CACHE FORCE`, and using the newer flag introduced in Emscripten 3.1.54 (2024). * Update binjgb and configure it in a more robust way Its `option` entries can (and do) override ours on first build, whereas `set()` takes precedence (but requires forcing it to honour a policy introduced in CMake 3.13, ugh). Related binjgb updating work in #155, for reference. * Force RGBDS to ignore its Git tags * Build in parallel in CI * Build with latest Node We were being bumped automatically to Node 24 by GitHub anyway, so might as well bite that bullet. * Cache NPM packages in CI * Build as many files as possible on CI failure So that we can get the most failures out of a single run, and thus the most info. --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: ISSOtm <me@eldred.fr> Co-authored-by: SelvinPL <przemek.sulikowski@gmail.com> Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
apply fixes for build: