diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 472bd044..bcf2059f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,9 +70,15 @@ jobs: - toolver: '14' build_type: x86-Release-Clang arch: amd64_x86 + - toolver: '14' + build_type: x64-VS + arch: amd64 + - toolver: '14' + build_type: x86-VS + arch: amd64_x86 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: 'Install Ninja' run: choco install ninja diff --git a/CMakeLists.txt b/CMakeLists.txt index 36342db3..962db6d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,7 +442,10 @@ if(directxmath_FOUND) endforeach() endif() -if(TOOL_EXES) +if (BUILD_TOOLS AND (CMAKE_GENERATOR MATCHES "Visual Studio")) + message(STATUS "Building tools: MakeSpriteFont;${TOOL_EXES}") + add_subdirectory(MakeSpriteFont) +elseif(TOOL_EXES) message(STATUS "Building tools: ${TOOL_EXES}") endif() diff --git a/CMakePresets.json b/CMakePresets.json index 63978a32..a0f0ea01 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -14,6 +14,15 @@ "binaryDir": "${sourceDir}/out/build/${presetName}", "installDir": "${sourceDir}/out/install/${presetName}" }, + { + "name": "vsbase", + "displayName": "Visual Studio Basic Config", + "description": "Basic build using Visual Studio generator", + "generator": "Visual Studio 17 2022", + "hidden": true, + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}" + }, { "name": "x64", "architecture": { @@ -259,6 +268,9 @@ { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug) for Windows 10", "inherits": [ "base", "ARM64EC", "Debug", "MSVC", "Win10" ] }, { "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release) for Windows 10", "inherits": [ "base", "ARM64EC", "Release", "MSVC", "Win10" ] }, + { "name": "x64-VS" , "description": "MSVC for x64 w/ Visual Studio generator", "inherits": [ "vsbase", "x64", "MSVC" ] }, + { "name": "x86-VS" , "description": "MSVC for x86 w/ Visual Studio generator", "inherits": [ "vsbase", "x86", "MSVC" ] }, + { "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] }, { "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] }, { "name": "x86-Debug-UWP" , "description": "MSVC for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "MSVC", "UWP" ] }, diff --git a/MakeSpriteFont/CMakeLists.txt b/MakeSpriteFont/CMakeLists.txt new file mode 100644 index 00000000..68a64d26 --- /dev/null +++ b/MakeSpriteFont/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +cmake_minimum_required (VERSION 3.21) + +project (MakeSpriteFont + DESCRIPTION "DirectX Tool Kit SpriteFont tool" + HOMEPAGE_URL "https://github.com/microsoft/DirectXTK" + LANGUAGES CSharp) + +add_executable(${PROJECT_NAME} + BitmapImporter.cs + BitmapUtils.cs + CharacterRegion.cs + CommandLineOptions.cs + CommandLineParser.cs + Glyph.cs + GlyphCropper.cs + GlyphPacker.cs + IFontImporter.cs + Program.cs + Properties/AssemblyInfo.cs + SpriteFontWriter.cs + TrueTypeImporter.cs) + + set_property(TARGET ${PROJECT_NAME} + PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2" + PROPERTY WIN32_EXECUTABLE TRUE) + + set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES + "Microsoft.CSharp" + "System" + "System.Drawing") + +set(CMAKE_CSharp_FLAGS "/platform:AnyCPU")