mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 17:02:51 +08:00
Add support for MSVS 2026
Update wx_config.props, add MSVS 2026 solutions for the library and samples, and update the docs. Closes #26131.
This commit is contained in:
@@ -35,7 +35,7 @@ This version of wxWidgets supports the following primary platforms:
|
||||
|
||||
All C++11 compilers are supported including but not limited to:
|
||||
|
||||
- Microsoft Visual C++ 2015 or later (up to 2022).
|
||||
- Microsoft Visual C++ 2015 or later (up to 2026).
|
||||
- g++ 4.8 or later (up to 15), including MinGW/MinGW-64/TDM under Windows.
|
||||
- Clang (up to 19/Xcode 16).
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(VisualStudioVersion)' == '18.0'">v145</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' >= '15.0' and '$(WindowsTargetPlatformVersion)'==''">
|
||||
<!-- Latest Target Version property -->
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<Solution>
|
||||
<Configurations>
|
||||
<BuildType Name="Debug" />
|
||||
<BuildType Name="DLL Debug" />
|
||||
<BuildType Name="DLL Release" />
|
||||
<BuildType Name="Release" />
|
||||
<Platform Name="ARM64" />
|
||||
<Platform Name="ARM64EC" />
|
||||
<Platform Name="Win32" />
|
||||
<Platform Name="x64" />
|
||||
</Configurations>
|
||||
<Project Path="wx_adv.vcxproj" Id="24c45343-fd20-5c92-81c1-35a2ae841e79">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_aui.vcxproj" Id="a16d3832-0f42-57ce-8f48-50e06649ade8">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
<BuildDependency Project="wx_html.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_base.vcxproj" Id="3fcc50c2-81e9-5db2-b8d8-2129427568b1">
|
||||
<BuildDependency Project="wx_custom_build.vcxproj" />
|
||||
<BuildDependency Project="wx_wxexpat.vcxproj" />
|
||||
<BuildDependency Project="wx_wxregex.vcxproj" />
|
||||
<BuildDependency Project="wx_wxzlib.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_core.vcxproj" Id="6744dad8-9c70-574a-bff2-9f8dddb24a75">
|
||||
<BuildDependency Project="wx_base.vcxproj" />
|
||||
<BuildDependency Project="wx_wxjpeg.vcxproj" />
|
||||
<BuildDependency Project="wx_wxpng.vcxproj" />
|
||||
<BuildDependency Project="wx_wxtiff.vcxproj" />
|
||||
<BuildDependency Project="wx_wxwebp.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_custom_build.vcxproj" Id="01f4ce10-2cfb-41a8-b41f-e54337868a1d" />
|
||||
<Project Path="wx_gl.vcxproj" Id="da8b15ef-6750-5928-bc0e-c748213cf9b2">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_html.vcxproj" Id="33cc42f9-7756-5587-863c-8d4461b7c5dd">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_media.vcxproj" Id="8bd8f8d9-4275-5b42-a8f4-f1db2970a550">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_net.vcxproj" Id="69f2ede4-7d21-5738-9bc0-f66f61c9ae00">
|
||||
<BuildDependency Project="wx_base.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_propgrid.vcxproj" Id="97fdab45-9c58-5bc5-a2f4-ee42739ebc63">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_qa.vcxproj" Id="e21129e0-7c08-5936-9d8c-0d60b5319ba7">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
<BuildDependency Project="wx_xml.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_ribbon.vcxproj" Id="87b42a9c-3f5c-53d7-9017-2b1cae39457d">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_richtext.vcxproj" Id="7fb0902d-8579-5dce-b883-daf66a885005">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
<BuildDependency Project="wx_html.vcxproj" />
|
||||
<BuildDependency Project="wx_xml.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_stc.vcxproj" Id="23e1c437-a951-5943-8639-a17f3cf2e606">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
<BuildDependency Project="wx_wxlexilla.vcxproj" />
|
||||
<BuildDependency Project="wx_wxscintilla.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_webview.vcxproj" Id="a8e8442a-078a-5fc5-b495-8d71ba77ee6e">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_wxexpat.vcxproj" Id="a1a8355b-0988-528e-9cc2-b971d6266669" />
|
||||
<Project Path="wx_wxjpeg.vcxproj" Id="6053cc38-cdee-584c-8bc8-4b000d800fc7" />
|
||||
<Project Path="wx_wxlexilla.vcxproj" Id="812eddee-840f-4807-a732-8a0b81409f39" />
|
||||
<Project Path="wx_wxpng.vcxproj" Id="8acc122a-ca6a-5aa6-9c97-9cdd2e533db0" />
|
||||
<Project Path="wx_wxregex.vcxproj" Id="56a4b526-bb81-5d01-aaa9-16d23bbb169d">
|
||||
<BuildDependency Project="wx_custom_build.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_wxscintilla.vcxproj" Id="74827ebd-93dc-5110-ba95-3f2ab029b6b0" />
|
||||
<Project Path="wx_wxtiff.vcxproj" Id="75596ce6-5ae7-55c9-b890-c07b0a657a83" />
|
||||
<Project Path="wx_wxwebp.vcxproj" Id="2d774e84-354b-415a-baf4-b13158808e6f" />
|
||||
<Project Path="wx_wxzlib.vcxproj" Id="8b867186-a0b5-5479-b824-e176edd27c40" />
|
||||
<Project Path="wx_xml.vcxproj" Id="3e6dca27-5fa3-53ec-bbd6-2d42294b7ae6">
|
||||
<BuildDependency Project="wx_base.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="wx_xrc.vcxproj" Id="09f2f96a-1cc6-5e43-af1d-956ec2a4888d">
|
||||
<BuildDependency Project="wx_core.vcxproj" />
|
||||
<BuildDependency Project="wx_html.vcxproj" />
|
||||
<BuildDependency Project="wx_xml.vcxproj" />
|
||||
</Project>
|
||||
</Solution>
|
||||
+36
-30
@@ -47,18 +47,24 @@ All makefiles and project are located in `build\msw` directory.
|
||||
Microsoft Visual C++ Compilation {#msw_build_msvs}
|
||||
----------------------------------------------------------------
|
||||
|
||||
Note. All the instructions for building wxWidgets and using it in
|
||||
applications with Microsoft Visual Studio (MSVS) assume that Microsoft
|
||||
Visual C++ (MSVC) is being used as the C++ compiler (not Clang/LLVM).
|
||||
|
||||
### From the IDE
|
||||
|
||||
Ready to use project files are provided for VC++ versions 2015, 2017, 2019 and 2022.
|
||||
Ready to use project files are provided for MSVS versions 2015, 2017, 2019,
|
||||
2022 and 2026.
|
||||
|
||||
Simply open `wx_vcN.sln` (for N=14, 15, 16 or 17) file,
|
||||
Simply open `wx_vcN.sln` (for N=14, 15, 16 or 17 matching MSVS versions
|
||||
between 2015 and 2022) or `wx_vc18.slnx` (for MSVS 2026) file,
|
||||
select the appropriate configuration (Debug or Release, static or DLL)
|
||||
and build the solution. Notice that when building a DLL configuration,
|
||||
you may need to perform the build several times because the projects
|
||||
are not always built in the correct order, and this may result in link
|
||||
errors. Simply do the build again, up to 3 times, to fix this.
|
||||
|
||||
Note that targeting ARM64 requires VC++ 2017 or newer, while ARM64EC and ARM64X
|
||||
Note that targeting ARM64 requires MSVS 2017 or newer, while ARM64EC and ARM64X
|
||||
require 2019 or newer and SDK 10.0.22621.0 or newer.
|
||||
|
||||
The custom build steps have not yet been tailored to support ARM64X, but it
|
||||
@@ -72,19 +78,19 @@ seems to work well if you build with `Platform=ARM64` first and then
|
||||
wxWidgets can also be built from the command line using the provided makefiles.
|
||||
|
||||
This needs to be done from the "Visual Studio Command Prompt" window, which can
|
||||
be opened using a shortcut installed to the "Start" menu or the "Start" screen
|
||||
by MSVS installation.
|
||||
be opened using a shortcut installed to the "Start" menu by MSVS installation.
|
||||
|
||||
In this window, change directory to `%%WXWIN%\build\msw` and type
|
||||
In this window, change directory to `%%WXWIN%\build\msw` and type (use the
|
||||
solution matching your MSVS version, the example uses wx_vc17.sln for MSVS 2022)
|
||||
|
||||
> msbuild /m /p:Configuration=Debug /p:Platform=x64 wx_vc17.sln
|
||||
|
||||
to build wxWidgets in the debug configuration as a static library using MSVS
|
||||
2022 (MSVC 17) toolset. Use "Release" configuration instead of "Debug" for the
|
||||
release version build and `wx_vc14.sln`, `wx_vc15.sln` or `wx_vc16.sln` for
|
||||
MSVS 2015, 2017 or 2019 respectively.
|
||||
to build wxWidgets in the debug configuration as a static library.
|
||||
Use `Release` configuration instead of `Debug` for the release version build.
|
||||
Similarly, use configurations `"DLL Debug"` and `"DLL Release"` for dynamic builds
|
||||
(the quotes around the configuration name are needed because it contains a space).
|
||||
|
||||
After the build completes, open `%%WXWIN%\samples\samples_vc17.sln` solution
|
||||
After the build completes, open the appropriate sample solution in `%%WXWIN%\samples\`
|
||||
and try building and running the minimal sample to verify that your build is
|
||||
functional.
|
||||
|
||||
@@ -132,9 +138,9 @@ contributors. If the version is out of date, please [create an issue or pull req
|
||||
|
||||
|
||||
|
||||
### Special notes for Visual Studio
|
||||
### Special notes for MSVS
|
||||
|
||||
For Visual Studio solutions it is possible to customize the build by
|
||||
For MSVS solutions it is possible to customize the build by
|
||||
creating a `wx_local.props` file in the `build\msw` directory which is used, if it
|
||||
exists, by the projects. The settings in that file override the default values
|
||||
for the properties such as wxCfg (corresponding to the CFG makefile variable
|
||||
@@ -142,15 +148,15 @@ described below) or wxVendor (corresponding to VENDOR). The typical way to
|
||||
make the file is to copy `wx_setup.props` to `wx_local.props` and then edit local.
|
||||
|
||||
For example, if you are building wxWidgets libraries using multiple versions
|
||||
of Visual Studio you could change wxCompilerPrefix to include the toolset:
|
||||
of MSVS you could change wxCompilerPrefix to include the toolset:
|
||||
|
||||
- <wxCompilerPrefix>vc</wxCompilerPrefix>
|
||||
+ <wxCompilerPrefix>vc$(PlatformToolsetVersion)</wxCompilerPrefix>
|
||||
|
||||
Following that example if you are using Visual Studio 2015 and open
|
||||
Following that example if you are using MSVS 2015 and open
|
||||
`wx_vc14.sln` it will build using the "vc140" prefix for the build directories
|
||||
so to allow its build files to coexist with the files produced by the other
|
||||
MSVC versions.
|
||||
MSVS versions.
|
||||
|
||||
Keep in mind that by using a separate local props file you ensure that your
|
||||
changes won't be lost when updating to a future wxWidgets version. But if
|
||||
@@ -159,12 +165,12 @@ updated with it. For example the version information in `wx_setup.props` could
|
||||
change and the information in your `wx_local.props` would be outdated. It is
|
||||
your responsibility to monitor for such situations.
|
||||
|
||||
### Improve debugging for Visual Studio
|
||||
### Improve debugging for MSVS
|
||||
|
||||
Debug visualizers which make inspecting various wxWidgets classes easier to view
|
||||
while debugging are provided in file `%%WXWIN%\misc\msvc\wxWidgets.natvis`.
|
||||
The visualisers can be either added to a project or installed system-wide.
|
||||
See the [Visual Studio documentation](https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects)
|
||||
See the [MSVS documentation](https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects)
|
||||
for more information.
|
||||
|
||||
|
||||
@@ -347,11 +353,11 @@ The full list of the build settings follows:
|
||||
|
||||
* `RUNTIME_LIBS=static`
|
||||
|
||||
(VC++ only.) Links static version of C and C++ runtime libraries into the
|
||||
(MSVC only.) Links static version of the CRT into the
|
||||
executable, so that the program does not depend on DLLs provided with the
|
||||
compiler.
|
||||
|
||||
Caution: Do not use static runtime libraries when building DLL (SHARED=1)!
|
||||
Caution: Do not use the static CRT when building DLL (SHARED=1)!
|
||||
|
||||
* `DEBUG_FLAG=0`
|
||||
* `DEBUG_FLAG=1`
|
||||
@@ -377,18 +383,18 @@ The full list of the build settings follows:
|
||||
* `DEBUG_RUNTIME_LIBS=0`
|
||||
* `DEBUG_RUNTIME_LIBS=1`
|
||||
|
||||
(VC++ only.) If set to 1, msvcrtd.dll is used, if to 0, msvcrt.dll
|
||||
is used. By default msvcrtd.dll is used only if the executable
|
||||
contains debug info and msvcrt.dll if it doesn't. It is sometimes
|
||||
(MSVC only.) If set to 1, the debug CRT is used, if to 0, the release CRT
|
||||
is used. By default the former is used only if the executable
|
||||
contains debug info and the latter if it doesn't. It is sometimes
|
||||
desirable to build with debug info and still link against msvcrt.dll
|
||||
(e.g. when you want to ship the app to customers and still have
|
||||
usable .pdb files with debug information) and this setting makes it
|
||||
possible.
|
||||
|
||||
* `TARGET_CPU=X64|ARM|ARM64|IA64`
|
||||
* `TARGET_CPU=X64|ARM|ARM64`
|
||||
|
||||
(VC++ only.) Set this variable to build for x86_64 systems. If unset, x86
|
||||
build is performed.
|
||||
(MSVC only.) Set this variable to build for the target architecture. If unset,
|
||||
then the default architecture for the active Developer Command Prompt is used.
|
||||
|
||||
* `VENDOR=<your company name>`
|
||||
|
||||
@@ -396,9 +402,9 @@ The full list of the build settings follows:
|
||||
distribute wxWidgets DLLs with your application. Default value is 'custom'.
|
||||
This string is included as part of DLL name. wxWidgets DLLs contain compiler
|
||||
name, version information and vendor name in them. For example
|
||||
`wxmsw311u_core_vc_custom.dll` is one of DLLs build using Visual C++ with
|
||||
`wxmsw331u_core_vc_x64_custom.dll` is one of DLLs built using MSVC with
|
||||
default settings. If you set VENDOR=mycorp, the name will change to
|
||||
`wxmsw311u_core_vc_mycorp.dll.`
|
||||
`wxmsw331u_core_vc_x64_mycorp.dll.`
|
||||
|
||||
* `CFG=<configuration name>`
|
||||
|
||||
@@ -435,7 +441,7 @@ Building Applications Using wxWidgets {#msw_build_apps}
|
||||
Note: If you want to use CMake for building your project, please see
|
||||
@ref overview_cmake.
|
||||
|
||||
Using Microsoft Visual C++ IDE {#msw_build_apps_msvc}
|
||||
Using MSVS {#msw_build_apps_msvc}
|
||||
------------------------------
|
||||
|
||||
If you use MSVS for building your project, simply add
|
||||
@@ -454,7 +460,7 @@ Using Other Compilers or Command Line {#msw_build_apps_other}
|
||||
|
||||
We suppose that wxWidgets sources are under the directory `$WXWIN` (notice that
|
||||
different tool chains refer to environment variables such as WXWIN in
|
||||
different ways, e.g. MSVC users should use `$``(WXWIN)` instead of just
|
||||
different ways, e.g. MSVS users should use `$``(WXWIN)` instead of just
|
||||
`$WXWIN`). And we will use `<wx-lib-dir>` as a shortcut for the subdirectory of
|
||||
`$WXWIN\lib` which is composed from several parts separated by underscore:
|
||||
first, a compiler-specific prefix (e.g. "vc" for MSVC, "gcc" for g++ or the
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user