Skip to content

Visual Studio Generators platform specification conflict #53

@RolfKal

Description

@RolfKal

In autobuild_tool_source_environment.py at line 750 and after it states:

            # Of course CMake also needs to know bit width :-P
            # Or at least it used to, until VS 2019.
            if os.environ["AUTOBUILD_ADDRSIZE"] == "64" and vsver < '160':
                AUTOBUILD_WIN_CMAKE_GEN += " Win64"

However this is not quite correct. Since cmake 3.1 the standard name is without " Win64" appendix and the x64 platform is passed through the "-A x64" option. Apparently the generator with " Win64" appendix did ignore in the past the "-A x64" option but at least in the latest cmake versions >= 3.30 it seems that passing "-A x64" when specifying a generator name with " Win64" appendix will cause a cmake error.

And cmake 4.0 and beyond has removed the " Win64" appendix option altogether and requires the platform to be passed through the -A option, which is created from the AUTOBUILD_WIN_VSPLATFORM environment variable.

Another point is that since cmake 3.1 the year behind the version is recommended although not quite required. But at least cmake 4.0 and later will not work without the year specification following the version.

Visual Studio 12 2013
Visual Studio 14 2015
Visual Studio 15 2017
Visual Studio 16 2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions