From 8c581898175f4fcf1e8ca088af04cbf4d8300c7c Mon Sep 17 00:00:00 2001 From: Edgar Date: Mon, 29 Nov 2021 10:54:42 +0100 Subject: [PATCH] :bug: Fixed build --- .conan-profiles/vs-2016-debug | 2 +- .conan-profiles/vs-2016-release | 2 +- .github/workflows/conan-pkg.yml | 3 +++ freeimage/all/conanfile.py | 8 +++++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.conan-profiles/vs-2016-debug b/.conan-profiles/vs-2016-debug index 44ab619..3ba5864 100644 --- a/.conan-profiles/vs-2016-debug +++ b/.conan-profiles/vs-2016-debug @@ -4,5 +4,5 @@ os_build=Windows arch=x86_64 arch_build=x86_64 compiler=Visual Studio -compiler.version=16 +compiler.version=15 build_type=Debug \ No newline at end of file diff --git a/.conan-profiles/vs-2016-release b/.conan-profiles/vs-2016-release index fb9f28c..375fa9d 100644 --- a/.conan-profiles/vs-2016-release +++ b/.conan-profiles/vs-2016-release @@ -4,5 +4,5 @@ os_build=Windows arch=x86_64 arch_build=x86_64 compiler=Visual Studio -compiler.version=16 +compiler.version=15 build_type=Release \ No newline at end of file diff --git a/.github/workflows/conan-pkg.yml b/.github/workflows/conan-pkg.yml index fb956ba..feda83e 100644 --- a/.github/workflows/conan-pkg.yml +++ b/.github/workflows/conan-pkg.yml @@ -58,6 +58,9 @@ jobs: file(DOWNLOAD https://cdn.anotherfoxguy.com/DirectX-SDK.zip "$ENV{TMP}/DirectX.zip" SHOW_PROGRESS) execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "$ENV{TMP}/DirectX.zip" WORKING_DIRECTORY "$ENV{DXSDK_DIR}") + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1.10.0 + - name: Run env: CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }} diff --git a/freeimage/all/conanfile.py b/freeimage/all/conanfile.py index c727976..ed09527 100644 --- a/freeimage/all/conanfile.py +++ b/freeimage/all/conanfile.py @@ -19,9 +19,11 @@ class freeimageConan(ConanFile): def build(self): if os_info.is_windows: - for file in glob.glob("./**/*2017.vcxproj", recursive=True): - print(f"Patching winsdk in file {file}") - tools.replace_in_file(file, "10.0.16299.0", "10.0", strict=False) + version = tools.Version(self.settings.compiler.version) + if version.major > "15": + for file in glob.glob("./**/*2017.vcxproj", recursive=True): + print(f"Patching winsdk in file {file}") + tools.replace_in_file(file, "10.0.16299.0", "10.0", strict=False) msbuild = MSBuild(self) msbuild.build("FreeImage.2017.sln") else: