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 toolchain support #140

Open
abeimler opened this issue Jul 21, 2022 · 2 comments
Open

Add toolchain support #140

abeimler opened this issue Jul 21, 2022 · 2 comments
Labels
enhancement New feature or request pr-welcome
Milestone

Comments

@abeimler
Copy link
Contributor

abeimler commented Jul 21, 2022

Add function to setup -DCMAKE_TOOLCHAIN_FILE/-DVCPKG_TOOLCHAIN_FILE and include() toolchain via -DOPT_TARGET_TRIPLET:STRING=x64-mingw-dynamic option.

Example:

project_options(
   TARGET_TRIPLET "x64-mingw-dynamic"
)

or with cmake arguments:

# for custom toolchains
cmake ... -DOPT_TOOLCHAIN_FILE:STRING="..." -DOPT_TARGET_TRIPLET:STRING="..."
## setup vcpkg and more

# use project_options toolchains
cmake ... -DOPT_TARGET_TRIPLET:STRING="..."
## setup vcpkg and more

# use vcpkg arguments
cmake ... -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="..." -DVCPKG_TARGET_TRIPLET="..."
## read vcpkg triplet and set OPT_TARGET_TRIPLET etc.

Notes

  • Cross compiler must setup by user
  • Maybe addition arguments must be pass for cross-compiler root path or other paths like Android NDK, emscripten SDK (emsdk), ...

Upvote & Fund

  • I am using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

  • Thank you in advance for helping prioritize & fund our backlog.

Fund with Polar
@aminya aminya added the enhancement New feature or request label Jul 21, 2022
@aminya
Copy link
Owner

aminya commented Jul 21, 2022

I have taken the automated approach to the toolchains; the user should not need to specify the toolchains manually. We detect the proper toolchain based on the compiler settings and the target system.

For example, for the msvc toolchain:

if(# if on windows and the generator is not Visual Studio
WIN32
AND NOT
CMAKE_GENERATOR
MATCHES
"Visual Studio*")
is_msvc(_is_msvc)

@aminya
Copy link
Owner

aminya commented Oct 19, 2022

We already detect MinGW and apply some fixes for it for VCPKG. You can use the same function to detect MinGW and include its toolchain.

function(is_mingw value)

@aminya aminya added this to the v1.0.0 milestone Oct 30, 2022
abeimler added a commit to abeimler/project_options that referenced this issue Oct 31, 2022
* add mingw toolchains
* add docker for testing
abeimler added a commit to abeimler/project_options that referenced this issue Oct 31, 2022
* add mingw toolchains
* add docker for testing
abeimler added a commit to abeimler/project_options that referenced this issue Oct 31, 2022
* add mingw toolchains
* add docker for testing
abeimler added a commit to abeimler/project_options that referenced this issue Nov 20, 2022
* add docker-compose
abeimler added a commit to abeimler/project_options that referenced this issue Nov 20, 2022
* fix path in toolchain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr-welcome
Projects
None yet
Development

No branches or pull requests

2 participants