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

Cannot specify WINAPI version to build against #63

Open
sodevel opened this issue May 28, 2024 · 6 comments
Open

Cannot specify WINAPI version to build against #63

sodevel opened this issue May 28, 2024 · 6 comments

Comments

@sodevel
Copy link

sodevel commented May 28, 2024

With b2 i can specify the Windows API version to build against with e.g. define=BOOST_USE_WINAPI_VERSION=0x0601 but unless i miss something this cannot be done for the CMake build.

@pdimov
Copy link
Member

pdimov commented May 28, 2024

@Lastique what do you think about this? A CMake option in winapi comes to mind.

@Lastique
Copy link
Member

In my libraries, I'm mirroring C++ defines to CMake options, so one would specify e.g. -DBOOST_USE_WINAPI_VERSION=0x0601 in cmake command line and that translates to the equivalent C++ define. I'll add this in Boost.WinAPI's CMakeLists.txt.

Lastique added a commit to boostorg/winapi that referenced this issue May 28, 2024
This allows users to specify BOOST_USE_WINAPI_VERSION in the CMake command
line to select the Windows version for Boost to target.

Requested in boostorg/cmake#63.
@Lastique
Copy link
Member

Done in boostorg/winapi@c5fb9c8.

@sodevel
Copy link
Author

sodevel commented May 30, 2024

Not sure if this is the right place for this nor am i involved with boost and know their policies, but looking at the cache variables, it looks like they are following the form BOOST_<LIBRARY>_FOO_BAR. Your introduced variable does violate this form, a valid variant would look like BOOST_WINAPI_USE_WINAPI_VERSION.

@pdimov
Copy link
Member

pdimov commented May 30, 2024

That's OK because it mirrors the macro name.

@Lastique
Copy link
Member

The intention was that BOOST_USE_WINAPI_VERSION would be a Boost-wide macro that affects all libraries using Windows API.

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

No branches or pull requests

3 participants