Artistic Style

Visual Studio 2022 and later

Building Artistic Style with Visual Studio

Following are instructions for installing Visual Studio 2022 or later and compiling Artistic Style for the Win32 and x64 platforms. The free Community edition is sufficient. Unlike the former Express editions, it contains the 64-bit compilers and the Windows SDK, so no separate SDK install is needed.

Installing Visual Studio

Download the Visual Studio installer and select the workload Desktop development with C++. It installs the MSVC compiler for x86 and x64 and a current Windows SDK. Optional components are:

Components can be added later by running the Visual Studio Installer again and selecting "Modify".

Using the Artistic Style Solution Files

The solution files are in the "build" directory:

Open a solution, select the configuration (Debug, Release or Static) and the platform (Win32 or x64) in the toolbar, and build. Win32 output is placed in the "debug", "bin" and "binstatic" directories, x64 output in the same directories below "x64". The solutions are described in the Install Information.

A newer Visual Studio release can open the solution of an older one. If the older platform toolset is not installed, use "Project > Retarget solution" to switch to the installed toolset.

Building from the Command Line

Open the "x64 Native Tools Command Prompt" or the "Developer PowerShell" from the Start menu and run MSBuild on a solution:

cd build\vs2022
msbuild "AStyle 2022.sln" /p:Configuration=Release /p:Platform=x64

CMake can generate Visual Studio projects as well. Use the generator "Visual Studio 17 2022" or "Visual Studio 18 2026" (this needs a CMake release that supports it):

cmake -B build-msvc -G "Visual Studio 17 2022" -A x64
cmake --build build-msvc --config Release

Adding a Platform to Your Own Project

New C++ projects already contain the Win32 and x64 platforms. To add a platform (e.g. ARM64) to an existing project, open "Build > Configuration Manager", select "<New...>" in "Active solution platform", choose the new platform, copy the settings from an existing platform and check "Create new project platforms".

To keep the output of the platforms apart, include the $(Platform) macro in "Configuration Properties > General > Output Directory", e.g. $(SolutionDir)$(Platform)\$(Configuration)\. The default Intermediate Directory already contains it.