-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Butano Toolchain does not appear to set necessary definitions. #49
Comments
I got lazy and kept saying "I'll fix this tomorrow"... |
Pushed a fix. Could you please check that this is working for you now @tfinnegan937 ? |
Will do! Thank you so much for looking at this for me. I'll report back shortly |
This does not appear to have fixed my issue. Current output:
Troubleshooting steps taken:
Here's the commit log for the submodule that I created and updated:
Furthermore, the .gitignore seems to be missing some of the CMake temporary files on the new version:
|
I also attempted to delete the lib/agbabi/ and lib/butano folders such that they would be re-pulled, but with no luck. Are these supposed to be downloaded in-source? I would have expected downloaded dependencies to get dropped in the folder that CMake is generating to. |
Here's a download link for my local repository if it helps with debugging. None of my own code is in there yet, either. I haven't pushed to github yet as I'm still working on setting up my build environment. gba-toolchain is a submodule in the third-party folder. I'm using VSCode with a devcontainer, and I have included the devcontainer.json in case you want to just boot into my environment with VSCode and test it as-is. https://drive.google.com/file/d/1urUDECDGB5OBXco54OP4aPctLch8n7xW/view?usp=sharing It's basically your example CMakeLists.txt modified for Butano, with your example CMakePresets.json modified to specify the build type. |
The downloaded dependencies get put into the toolchain lib/ directory The fact that it says undefined symbol for BN_ROM_START suggests it's still using a cached/out of date CMakeLists.txt for Butano Also Butano comes with its own flavour of agbabi, so you shouldn't have that in your CMakeLists.txt if you happen to have that |
@felixjones After completely clearing my cache, I get the following output:
The BN_ROM_START symbol is declared, but _bn_audio_soundbank_bin is not. It also seems to be able to find the new values -- __text_start and rom_end |
Here's my latest CMakeLists: cmake_minimum_required(VERSION 3.18)
project(my_project LANGUAGES C CXX)
add_executable(my_executable src/main.c)
# gba-toolchain sets `CMAKE_SYSTEM_NAME` to `AdvancedGameBoy`
if(CMAKE_SYSTEM_NAME STREQUAL AdvancedGameBoy)
find_package(butano REQUIRED)
find_package(librom REQUIRED)
target_compile_options(my_executable PUBLIC -mthumb -fconserve-stack -fomit-frame-pointer)
target_link_libraries(my_executable PUBLIC butano librom)
# ROM header info
set_target_properties(my_executable PROPERTIES
ROM_TITLE "My Game"
ROM_ID AABE
ROM_MAKER CD
ROM_VERSION 1
)
# install to .gba
install_rom(my_executable)
endif() |
Ah looks like I did something stupid with devkitArm I imagine EDIT: I pushed another fix that should solve the text start and rom end problem |
Can you generate a dummy file if no assets are provided for the soundbank_bin? Something with the correct headers, but no content? I'll give the new fix a try and report back. |
This patch has fixed the issue, however, a few lingering issues still remain:
|
The toolchain is intended to be reused between multiple GBA projects, so these aren't downloaded dependencies, these are downloaded libraries For example, I have well over 30 different GBA projects using this toolchain, if they all individually downloaded their dependencies then I'd have these libraries downloaded 30 times each I believe in the example project I set up gba-toolchain as a git submodule, but that was only for convenience and isn't the recommended way to use the toolchain |
I am building from main with the following CMakeLists.txt
In response, I get the following output:
Looking at the butano-dka.make file at https://github.com/GValiente/butano/blob/master/butano/butano_dka.mak, it appears that BN_ROM_START and BN_ROM_END should be set to __text_start and rom_end respectively.
Using add_definitions or add_compile_definitions to add in those values does not appear to fix the issue:
add_definitions( -DBN_ROM_START=__text_start -DBN_ROM_END=__rom_end__ )
I suspect that this might be because I'm missing an add_butano_assets call (I dont have any assets yet, I'm just now setting up my build system), but I don't think a lack of assets should prevent a build (if that is the issue).
The text was updated successfully, but these errors were encountered: