MarkSchofield / WindowsToolchain

A repository containing a CMake toolchain for using MSVC
MIT License
79 stars 17 forks source link

Amalgamated toolchain file for release? #63

Open bharatvaj opened 1 year ago

bharatvaj commented 1 year ago

Hey, great project first of all! Currently the only possible way to consume the toolchain is by adding this as a submodule to the project or by adding it as a zip. Both have their disadvantages. Is it possible to produce a amalgamated script? A single cmake script file would be a great addition to the source zips that are already provided and it would be much more simpler to curl and reference.

MarkSchofield commented 1 year ago

Thanks! That's an interesting idea, but - TBH - I don't think I've seen precedent for that. Is there an example project that amalgamates CMake scripts? Is there tooling for this, or is it something I'd have to script?

I might have to get back to the feedback from #18 before tackling this.

aminya commented 1 year ago

You can easily get this toolchain via FetchContent.

      include(FetchContent)
      FetchContent_Declare(_msvc_toolchain
                           URL "https://github.com/MarkSchofield/WindowsToolchain/archive/refs/tags/v0.6.0.zip")
      FetchContent_MakeAvailable(_msvc_toolchain)
      include("${_msvc_toolchain_SOURCE_DIR}/Windows.MSVC.toolchain.cmake")

https://github.com/aminya/project_options/blob/26e338214f5e39e45efdcf02e285638d36508242/src/VCEnvironment.cmake#L69-L72

I don't think copy-pasting code is a good long-term solution.

bharatvaj commented 1 year ago

@MarkSchofield I can't find any to do the amalgamation either. I thought that we would be just cat'ng all cmake files and making it available on release page, but I guess it won't be possible without tackling #18 as you mentioned. What @aminya mentioned seems to be a good way of consuming this toolchain. Maybe it should be added in the "How do I use this?" section as a recommendation? as the cmake link that's already there doesn't cover the distribution part.

MarkSchofield commented 1 year ago

Sounds good! I’ll add some documentation on consumption strategies.