Skip to content

refactor(build)!: switch to cmake#284

Closed
gradylink wants to merge 41 commits intomainfrom
refactor/cmake
Closed

refactor(build)!: switch to cmake#284
gradylink wants to merge 41 commits intomainfrom
refactor/cmake

Conversation

@gradylink
Copy link
Member

@gradylink gradylink commented Aug 22, 2025

Doing this has many positive side effects, firstly each platform shouldn't need its own Makefile anymore, secondly, this makes it so that we are no longer embedding external dependencies in our project (Closes #47), and thirdly, it should eliminate the need for globally installing the weird dependencies we require for cloud variables (and maybe other things in the future.)

Note

If a platform, says it can be built for that platform but does not say it has romfs for that platform that means, that it builds but doesn't work due to missing assets. This is excluding the PC port which doesn't embed assets.

Checklist

  • Build for PC
  • Build for Wii U
  • Build for 3DS
  • Build for Switch
  • Build for Wii
  • Build for GameCube
  • Build for Vita
  • RomFS
    • 3DS
    • Wii U
    • GameCube
    • Wii
    • Switch
    • PC (using CMakeRC) (Won't be part of this PR, likely will be added later)
    • Vita
  • Support Cloud Variables
  • Compilation Flags
  • Correct target names
  • App Info
    • Wii U
      • WUHB
      • meta.xml
    • Wii
    • 3DS
      • .3dsx
      • .cia
    • Switch
    • Vita
  • Remove Makefiles and Embedded External Dependencies
  • Update Dockerfiles and nightly builds
  • Add project.sb3 to Vita build

@gradylink
Copy link
Member Author

gradylink commented Aug 22, 2025

I almost have Wii U support working.

EDIT: BRO IS THERE F***ING BUG IN DEVKITPRO SDL2 OR SOMETHING, WHY IS IT NOT COMPILING, I'VE TRIED BOTH VERSIONS!!!!

EDIT 2: I just switched to find_package for sdl2 libs

@gradylink gradylink mentioned this pull request Aug 23, 2025
7 tasks
@gradylink gradylink mentioned this pull request Aug 23, 2025
12 tasks
@gradylink gradylink changed the title [WIP+EXPERIMENT] refactor(build): switch to cmake [WIP+EXPERIMENT] refactor(build)!: switch to cmake Sep 9, 2025
@gradylink gradylink changed the title [WIP+EXPERIMENT] refactor(build)!: switch to cmake refactor(build)!: switch to cmake Sep 9, 2025
@gradylink gradylink marked this pull request as ready for review September 9, 2025 23:08
@gradylink gradylink requested review from Dogo6647 and NateXS September 9, 2025 23:09
Copy link
Member

@Dogo6647 Dogo6647 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me :)

@gradylink gradylink mentioned this pull request Sep 10, 2025
15 tasks
@GNUfault
Copy link
Contributor

GNUfault commented Oct 1, 2025

LGTM

@gradylink
Copy link
Member Author

LGTM

There are known issues... Which is why it hasn't been merged.

@GNUfault
Copy link
Contributor

GNUfault commented Oct 1, 2025

There are known issues... Which is why it hasn't been merged.

Yeah, I kinda just mean it looks good at first glance

@Squawkykaka
Copy link

Does this support linux? or is that something that needs to be added?

@gradylink
Copy link
Member Author

gradylink commented Oct 1, 2025

Does this support linux? or is that something that needs to be added?

It does, but the issue is that it fails when trying to build libcurl (what's weird is it was working then it stopped without me changing anything...) for 3DS and Wii U. The conflicts aren't an issue, most of them are just Makefile changes I need to mirror to the CMakeLists.txt.

@GNUfault
Copy link
Contributor

GNUfault commented Oct 1, 2025

Does this support linux? or is that something that needs to be added?

It does, but the issue is that it fails when trying to build libcurl (what's weird is it was working then it stopped without me changing anything...) for 3DS and Wii U. The conflicts aren't an issue, most of them are just Makefile changes I need to mirror to the CMakeLists.txt.

I see

[connor@Void-T480s ScratchEverywhere]$ cmake .
-- The CXX compiler identification is GNU 14.2.1
-- The C compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Downloading CPM.cmake...
CMake Error at CMakeLists.txt:14 (message):
  Failed to download CPM.cmake: 0;"No error"

  Host github.com:443 was resolved.
  ...

@gradylink
Copy link
Member Author

Does this support linux? or is that something that needs to be added?

It does, but the issue is that it fails when trying to build libcurl (what's weird is it was working then it stopped without me changing anything...) for 3DS and Wii U. The conflicts aren't an issue, most of them are just Makefile changes I need to mirror to the CMakeLists.txt.

I see

[connor@Void-T480s ScratchEverywhere]$ cmake .
-- The CXX compiler identification is GNU 14.2.1
-- The C compiler identification is GNU 14.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Downloading CPM.cmake...
CMake Error at CMakeLists.txt:14 (message):
  Failed to download CPM.cmake: 0;"No error"

  Host github.com:443 was resolved.
  ...

That's actually an issue with your dev environment, you need to be connected to the internet on first build.

@GNUfault
Copy link
Contributor

GNUfault commented Oct 2, 2025

That's actually an issue with your dev environment, you need to be connected to the internet on first build.

But I am, I never was offline:

[connor@Void-T480s ~]$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=55 time=16.2 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=55 time=11.6 ms
^C
--- 1.1.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 11.607/13.909/16.211/2.302 ms
[connor@Void-T480s ~]$

@gradylink
Copy link
Member Author

That's actually an issue with your dev environment, you need to be connected to the internet on first build.

But I am, I never was offline:

[connor@Void-T480s ~]$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=55 time=16.2 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=55 time=11.6 ms
^C
--- 1.1.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 11.607/13.909/16.211/2.302 ms
[connor@Void-T480s ~]$

I assumed given that it was unable to resolve GitHub that definitely means something is wrong in your environment, maybe try using Docker.

@gradylink
Copy link
Member Author

This changes in this PR are going to be merged in a more unconventional way, we are going to directly migrate individual platforms at a time in the main branch due to the fact that the kind of conflicts PRs like this cause are nearly impossible to fix.

@gradylink gradylink closed this Oct 31, 2025
@gradylink gradylink deleted the refactor/cmake branch November 30, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External dependencies should be using git submodules

4 participants