From 2ae548edbbf6ffef5a034b9c9fc1740227b1fd93 Mon Sep 17 00:00:00 2001 From: Dario Passet Date: Wed, 29 Apr 2026 16:59:57 +0200 Subject: [PATCH] Configurazione per compilare con Visual Studio 2026 aggiunta, sia con gli strumenti di compilazione v143 che v145. --- CMake/Conan.cmake | 6 +- CMake/Piattaforme/Windows/Impostazioni.cmake | 8 +++ CMakeLists.txt | 8 ++- CMakePresets.json | 68 ++++++++++++++++--- ...Windows Visual Studio 2022 v143 x64 debug} | 0 ...ndows Visual Studio 2022 v143 x64 release} | 0 .../Windows Visual Studio 2026 v143 x64 debug | 12 ++++ ...indows Visual Studio 2026 v143 x64 release | 12 ++++ .../Windows Visual Studio 2026 v145 x64 debug | 12 ++++ ...indows Visual Studio 2026 v145 x64 release | 12 ++++ conanfile.py | 6 +- 11 files changed, 126 insertions(+), 18 deletions(-) rename Profili Conan/{Windows v143 x64 debug => Windows Visual Studio 2022 v143 x64 debug} (100%) rename Profili Conan/{Windows v143 x64 release => Windows Visual Studio 2022 v143 x64 release} (100%) create mode 100644 Profili Conan/Windows Visual Studio 2026 v143 x64 debug create mode 100644 Profili Conan/Windows Visual Studio 2026 v143 x64 release create mode 100644 Profili Conan/Windows Visual Studio 2026 v145 x64 debug create mode 100644 Profili Conan/Windows Visual Studio 2026 v145 x64 release diff --git a/CMake/Conan.cmake b/CMake/Conan.cmake index fd05a7b..34ccb10 100644 --- a/CMake/Conan.cmake +++ b/CMake/Conan.cmake @@ -18,7 +18,7 @@ endif() set(CONAN_PROFILE_DIR "${CMAKE_SOURCE_DIR}/Profili Conan") if (WIN32) - set(CONAN_PROFILE_NAME "Windows ${CMAKE_GENERATOR_TOOLSET} x64") + set(CONAN_PROFILE_NAME "Windows Visual Studio ${VS_YEAR} ${CMAKE_GENERATOR_TOOLSET} x64") set(CONAN_PROFILE_DEBUG "${CONAN_PROFILE_DIR}/${CONAN_PROFILE_NAME} debug") set(CONAN_PROFILE_RELEASE "${CONAN_PROFILE_DIR}/${CONAN_PROFILE_NAME} release") set(CONAN_PROFILE_DEBUG_TIMESTAMP "${CMAKE_BINARY_DIR}/${CONAN_PROFILE_NAME} debug.timestamp") @@ -127,5 +127,5 @@ endif() # ----- Configurazione percorsi di ricerca usati per trovare i pacchetti ----- -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CONAN_OUTPUT_DIR}/conan") -set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CONAN_OUTPUT_DIR}/conan") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CONAN_OUTPUT_DIR}/Conan") +set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CONAN_OUTPUT_DIR}/Conan") diff --git a/CMake/Piattaforme/Windows/Impostazioni.cmake b/CMake/Piattaforme/Windows/Impostazioni.cmake index 7de039e..75ee94a 100644 --- a/CMake/Piattaforme/Windows/Impostazioni.cmake +++ b/CMake/Piattaforme/Windows/Impostazioni.cmake @@ -1,6 +1,14 @@ # ----- Impostazioni specifiche per Windows ----- if(MSVC) + if(${CMAKE_VS_VERSION_BUILD_NUMBER} VERSION_GREATER_EQUAL "18" AND ${CMAKE_VS_VERSION_BUILD_NUMBER} VERSION_LESS "19") + set(VS_YEAR "2026") + elseif(${CMAKE_VS_VERSION_BUILD_NUMBER} VERSION_GREATER_EQUAL "17" AND ${CMAKE_VS_VERSION_BUILD_NUMBER} VERSION_LESS "18") + set(VS_YEAR "2022") + else() + message(FATAL_ERROR "La versione ${CMAKE_VS_VERSION_BUILD_NUMBER} di Visual Studio non è supportata.") + endif() + include(CMake/Compilatori/MSVC/Funzioni.cmake) include(CMake/Compilatori/MSVC/Impostazioni.cmake) else() diff --git a/CMakeLists.txt b/CMakeLists.txt index 22d289a..5139ec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,8 +65,12 @@ add_custom_target(SolutionItems SOURCES "Profili Conan/Linux GCC 13 x64 release" "Profili Conan/Linux GCC 14 x64 debug" "Profili Conan/Linux GCC 14 x64 release" - "Profili Conan/Windows v143 x64 debug" - "Profili Conan/Windows v143 x64 release" + "Profili Conan/Windows Visual Studio 2022 v143 x64 debug" + "Profili Conan/Windows Visual Studio 2022 v143 x64 release" + "Profili Conan/Windows Visual Studio 2026 v143 x64 debug" + "Profili Conan/Windows Visual Studio 2026 v143 x64 release" + "Profili Conan/Windows Visual Studio 2026 v145 x64 debug" + "Profili Conan/Windows Visual Studio 2026 v145 x64 release" "Terze parti/CMakeLists.txt" "Terze parti/ImGui-Config.patch" diff --git a/CMakePresets.json b/CMakePresets.json index 8e1b43b..e582fb9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -32,16 +32,40 @@ } }, { - "name": "windows-v143", + "name": "windows-vs2022-v143", "hidden": true, "inherits": [ "windows-base-preset" ], "generator": "Visual Studio 17 2022", "toolset": "v143" }, { - "name": "windows-v143-x64", - "displayName": "Windows v143 x64", - "inherits": [ "windows-x64", "windows-v143" ] + "name": "windows-vs2022-v143-x64", + "displayName": "Windows Visual Studio 2022 v143 x64", + "inherits": [ "windows-x64", "windows-vs2022-v143" ] + }, + { + "name": "windows-vs2026-v143", + "hidden": true, + "inherits": [ "windows-base-preset" ], + "generator": "Visual Studio 18 2026", + "toolset": "v143" + }, + { + "name": "windows-vs2026-v143-x64", + "displayName": "Windows Visual Studio 2026 v143 x64", + "inherits": [ "windows-x64", "windows-vs2026-v143" ] + }, + { + "name": "windows-vs2026-v145", + "hidden": true, + "inherits": [ "windows-base-preset" ], + "generator": "Visual Studio 18 2026", + "toolset": "v145" + }, + { + "name": "windows-vs2026-v145-x64", + "displayName": "Windows Visual Studio 2026 v145 x64", + "inherits": [ "windows-x64", "windows-vs2026-v145" ] }, { "name": "linux-base-preset", @@ -213,15 +237,39 @@ "hidden": true }, { - "name": "windows-v143-x64-debug", - "displayName": "Windows v143 x64 debug", - "configurePreset": "windows-v143-x64", + "name": "windows-vs2022-v143-x64-debug", + "displayName": "Windows Visual Studio 2022 v143 x64 debug", + "configurePreset": "windows-vs2022-v143-x64", + "inherits": [ "base-build-msvc-x64-debug" ] + }, + { + "name": "windows-vs2022-v143-x64-release", + "displayName": "Windows Visual Studio 2022 v143 x64 release", + "configurePreset": "windows-vs2022-v143-x64", + "inherits": [ "base-build-msvc-x64-release" ] + }, + { + "name": "windows-vs2026-v143-x64-debug", + "displayName": "Windows Visual Studio 2026 v143 x64 debug", + "configurePreset": "windows-vs2026-v143-x64", + "inherits": [ "base-build-msvc-x64-debug" ] + }, + { + "name": "windows-vs2026-v143-x64-release", + "displayName": "Windows Visual Studio 2026 v143 x64 release", + "configurePreset": "windows-vs2026-v143-x64", + "inherits": [ "base-build-msvc-x64-release" ] + }, + { + "name": "windows-vs2026-v145-x64-debug", + "displayName": "Windows Visual Studio 2026 v145 x64 debug", + "configurePreset": "windows-vs2026-v145-x64", "inherits": [ "base-build-msvc-x64-debug" ] }, { - "name": "windows-v143-x64-release", - "displayName": "Windows v143 x64 release", - "configurePreset": "windows-v143-x64", + "name": "windows-vs2026-v145-x64-release", + "displayName": "Windows Visual Studio 2026 v145 x64 release", + "configurePreset": "windows-vs2026-v145-x64", "inherits": [ "base-build-msvc-x64-release" ] }, { diff --git a/Profili Conan/Windows v143 x64 debug b/Profili Conan/Windows Visual Studio 2022 v143 x64 debug similarity index 100% rename from Profili Conan/Windows v143 x64 debug rename to Profili Conan/Windows Visual Studio 2022 v143 x64 debug diff --git a/Profili Conan/Windows v143 x64 release b/Profili Conan/Windows Visual Studio 2022 v143 x64 release similarity index 100% rename from Profili Conan/Windows v143 x64 release rename to Profili Conan/Windows Visual Studio 2022 v143 x64 release diff --git a/Profili Conan/Windows Visual Studio 2026 v143 x64 debug b/Profili Conan/Windows Visual Studio 2026 v143 x64 debug new file mode 100644 index 0000000..59fccf6 --- /dev/null +++ b/Profili Conan/Windows Visual Studio 2026 v143 x64 debug @@ -0,0 +1,12 @@ +[settings] +arch=x86_64 +build_type=Debug +compiler=msvc +compiler.cstd=17 +compiler.cppstd=20 +compiler.runtime=dynamic +compiler.runtime_type=Debug +compiler.version=194 +os=Windows +[conf] +tools.microsoft.msbuild:vs_version=18 diff --git a/Profili Conan/Windows Visual Studio 2026 v143 x64 release b/Profili Conan/Windows Visual Studio 2026 v143 x64 release new file mode 100644 index 0000000..531fc1b --- /dev/null +++ b/Profili Conan/Windows Visual Studio 2026 v143 x64 release @@ -0,0 +1,12 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=msvc +compiler.cstd=17 +compiler.cppstd=20 +compiler.runtime=dynamic +compiler.runtime_type=Release +compiler.version=194 +os=Windows +[conf] +tools.microsoft.msbuild:vs_version=18 diff --git a/Profili Conan/Windows Visual Studio 2026 v145 x64 debug b/Profili Conan/Windows Visual Studio 2026 v145 x64 debug new file mode 100644 index 0000000..d2a08da --- /dev/null +++ b/Profili Conan/Windows Visual Studio 2026 v145 x64 debug @@ -0,0 +1,12 @@ +[settings] +arch=x86_64 +build_type=Debug +compiler=msvc +compiler.cstd=17 +compiler.cppstd=20 +compiler.runtime=dynamic +compiler.runtime_type=Debug +compiler.version=195 +os=Windows +[conf] +tools.microsoft.msbuild:vs_version=18 diff --git a/Profili Conan/Windows Visual Studio 2026 v145 x64 release b/Profili Conan/Windows Visual Studio 2026 v145 x64 release new file mode 100644 index 0000000..24da28f --- /dev/null +++ b/Profili Conan/Windows Visual Studio 2026 v145 x64 release @@ -0,0 +1,12 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=msvc +compiler.cstd=17 +compiler.cppstd=20 +compiler.runtime=dynamic +compiler.runtime_type=Release +compiler.version=195 +os=Windows +[conf] +tools.microsoft.msbuild:vs_version=18 diff --git a/conanfile.py b/conanfile.py index 5792d5f..1908995 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class ConanApplication(ConanFile): def layout(self): cmake_layout(self) - self.folders.generators = "conan" + self.folders.generators = "Conan" def generate(self): cmake = CMakeDeps(self) @@ -18,7 +18,7 @@ def generate(self): def system_requirements(self): packages = [ # SDL3 - "libsdl3-dev", # Su Linux uso SDL3 dai pacchetti di sistema poiché il pacchetto conan non funziona con wayland + "libsdl3-dev", # Su Linux uso SDL3 dai pacchetti di sistema poiché il pacchetto Conan non funziona con Wayland # Vulkan "libvulkan-dev", "vulkan-utility-libraries-dev" @@ -35,6 +35,6 @@ def requirements(self): self.requires("nlohmann_json/3.12.0") self.requires("platformfolders/4.3.0") self.requires("plutosvg/0.0.7") - # Il pacchetto conan di SDL3 è rotto e non funziona con wayland su Linux per tanto lo utilizzo solamente su Windows + # Il pacchetto conan di SDL3 è rotto e non funziona con Wayland su Linux per tanto lo utilizzo solamente su Windows if self.settings.os == "Windows": self.requires("sdl/3.2.20")