Skip to content
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

Add cmake and corresponding toolchain files, add zip, fix $PATH for devkitA64 to work with cmake #4

Closed
wants to merge 3 commits into from

Conversation

rsn8887
Copy link

@rsn8887 rsn8887 commented Mar 15, 2019

This allows building Switch homebrew with cmake, and adds zip. Zip is often used to package homebrew on the Switch.

Fixes #3

@rsn8887
Copy link
Author

rsn8887 commented Mar 15, 2019

Note: this makes building Switch apps out-of-the-box possible when they use cmake, not just when they use make, which I hope is the goal here.

Without this PR, $PATH to devkitpro gnu compiler drivers was not set, cmake was not there, zip was missing.


ENV PATH=$DEVKITPRO/devkitA64/bin:$PATH
Copy link
Member

Choose a reason for hiding this comment

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

devkitA64 should not be in global path. If we do this it then encourages sloppy projects that will cause problems for users. We've already seen this happen with people having multiple arm-none-eabi toolchains installed and attempting to use the wrong one for the wrong project.

Copy link
Author

@rsn8887 rsn8887 Mar 15, 2019

Choose a reason for hiding this comment

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

How to make it work with switch.cmake then? I thought the point of switch.cmake was to allow users to compile without manually having to set any paths (apart from having a $DEVKITPRO env var). But I tried, and switch.cmake doesn't find the compilers unless I set the path. So compilation fails.

Copy link
Member

@WinterMute WinterMute Mar 15, 2019

Choose a reason for hiding this comment

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

No. The point of switch.cmake is to help compiling ports which require cmake. The point of our Makefile based templates is to allow users to just run make & not care about any setup before building a project. Unfortunately cmake appears incapable of manipulating the environment in the way we manage with our standard Makefiles.

Currently we're sourcing switchvars.sh before running cmake, like this -> https://github.com/devkitPro/pacman-packages/blob/9128546582338c06d4fc11160cc04081823bc310/switch/bulletphysics/PKGBUILD#L20

There is some more discussion on updating the cmake support files here - devkitPro/pacman-packages#64

Like I said on IRC, this is all a WiP and many things still need to be done despite the many things that have already been done.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, understood.

@rsn8887 rsn8887 closed this Mar 15, 2019
@rsn8887 rsn8887 deleted the cmake branch March 19, 2019 22:48
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.

2 participants