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 user guide #12

Open
matteodelabre opened this issue Apr 9, 2021 · 2 comments
Open

Add user guide #12

matteodelabre opened this issue Apr 9, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@matteodelabre
Copy link
Member

No description provided.

@matteodelabre matteodelabre added the documentation Improvements or additions to documentation label Apr 9, 2021
@matteodelabre
Copy link
Member Author

@matteodelabre
Copy link
Member Author

From #13:

Regarding setting a default value in the environment for CMAKE_TOOLCHAIN_FILE, I’m actually not convinced it’s the best solution. Consider projects that need to build some executables with the “normal” gcc compiler, and then use the resulting executables in the cross build [1]. Setting a default for CMAKE_TOOLCHAIN_FILE in this case will break the part that needs the normal gcc. We would need to unset the env var before running cmake to build the first part, and then setting the env var back before building the second part. This is also the reason why I haven’t overridden the CC and CXX env vars in the image: some parts of the build may want the normal gcc, and some other parts the cross gcc. I think it’s best that each part explicitly declares which compiler it wants, for example by passing the CMAKE_TOOLCHAIN_FILE argument for CMake projects, or setting the CXX variable, etc.

As you’ve mentioned, having such a behavior differ from the oecore toolchain means both toolchains need to be handled differently. This may not be desirable. But the oecore behavior is really not ideal for projects having a dual-compiler layout.

[1] I have encountered such cases before. This can be used for example to generate some code that is used for the second half of the build.

Originally posted by @matteodelabre in #13 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant