Skip to content

Commit

Permalink
cmake: Fix a build error on iOS
Browse files Browse the repository at this point in the history
Avoid the awk-based configuration when cross-compiling from macOS
to iOS.
  • Loading branch information
ssrobins authored and ctruta committed May 17, 2020
1 parent 6dd99ca commit 5e8b45c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Revised by Cosmin Truta, 2018
# Revised by Kyle Bentley, 2018
# Revised by David Callu, 2020
# Revised by Steve Robinson, 2020

# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
Expand Down Expand Up @@ -273,7 +274,7 @@ find_program(AWK NAMES gawk awk)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

if(NOT AWK OR ANDROID)
if(NOT AWK OR ANDROID OR IOS)
# No awk available to generate sources; use pre-built pnglibconf.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
Expand Down Expand Up @@ -452,7 +453,7 @@ else()
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
endif(NOT AWK OR ANDROID)
endif(NOT AWK OR ANDROID OR IOS)

# OUR SOURCES
set(libpng_public_hdrs
Expand All @@ -466,7 +467,7 @@ set(libpng_private_hdrs
pnginfo.h
pngstruct.h
)
if(AWK AND NOT ANDROID)
if(AWK AND NOT ANDROID AND NOT IOS)
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
endif()
set(libpng_sources
Expand Down

0 comments on commit 5e8b45c

Please sign in to comment.