Skip to content

Commit

Permalink
[libpng] Define CMAKE_SYSTEM_PROCESSOR to avoid double-eval failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Jun 20, 2017
1 parent d3d5279 commit bfc6872
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/libpng/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libpng
Version: 1.6.29-1
Version: 1.6.29-2
Build-Depends: zlib
Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files.
8 changes: 8 additions & 0 deletions ports/libpng/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ else()
set(PNG_SHARED_LIBS OFF)
endif()

# Libpng's cmake uses if(${CMAKE_SYSTEM_PROCESSOR} ....) which performs double-evaluation and breaks if the variable is not defined.
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
else()
set(CMAKE_SYSTEM_PROCESSOR ${VCPKG_TARGET_ARCHITECTURE})
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
Expand All @@ -32,6 +39,7 @@ vcpkg_configure_cmake(
-DSKIP_INSTALL_PROGRAMS=ON
-DSKIP_INSTALL_EXECUTABLES=ON
-DSKIP_INSTALL_FILES=ON
-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
)
Expand Down

0 comments on commit bfc6872

Please sign in to comment.