From 1a36126af9d85fc91bbd56717c6712471bdf2817 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Sun, 20 Oct 2019 22:58:44 -0700 Subject: [PATCH] [imgui] Add architecture detection when building example --- ports/imgui/CONTROL | 4 ++-- ports/imgui/portfile.cmake | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 6484a925ac79d1..c4c52bbda0d1d3 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,8 +1,8 @@ Source: imgui -Version: 1.73-1 +Version: 1.73-2 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. Feature: example Description: build with examples -Build-Depends: glfw3, freeglut, opengl, sdl1 +Build-Depends: glfw3, freeglut, opengl, sdl1 \ No newline at end of file diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 62d674353859ac..af04ed5074c1b6 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -25,9 +25,19 @@ if ("example" IN_LIST FEATURES) if (NOT VCPKG_TARGET_IS_WINDOWS) message(FATAL_ERROR "Feature example only support windows.") endif() + + if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") + set(BUILD_ARCH "Win32") + elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64") + set(BUILD_ARCH "x64") + else() + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") + endif() + vcpkg_build_msbuild( USE_VCPKG_INTEGRATION PROJECT_PATH ${SOURCE_PATH}/examples/imgui_examples.sln + PLATFORM ${BUILD_ARCH} ) # Install headers