mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Fix for universal binaries on macOS
Fix the issue of a
clang: error: no such file or directory: 'x86_64'
error on building universal binaries on macOS.
It is also necessary to specify:
-DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"
Example CMake command:
cmake -S libpng \
-B build_libpng \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
committed by
Cosmin Truta
parent
9923515ff4
commit
cd0ea2a7f5
@@ -1,6 +1,6 @@
|
||||
# CMakeLists.txt
|
||||
|
||||
# Copyright (c) 2018-2022 Cosmin Truta
|
||||
# Copyright (c) 2018-2023 Cosmin Truta
|
||||
# Copyright (c) 2007,2009-2018 Glenn Randers-Pehrson
|
||||
# Written by Christian Ehrlicher, 2007
|
||||
# Revised by Roger Lowman, 2009-2010
|
||||
@@ -20,6 +20,7 @@
|
||||
# Revised by Gleb Mazovetskiy, 2021
|
||||
# Revised by Christopher Sean Morrison, 2022
|
||||
# Revised by Martin Storsjo, 2022
|
||||
# Revised by Jon Creighton, 2023
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
|
||||
@@ -24,10 +24,10 @@ set(ZLIBINCDIR "@ZLIB_INCLUDE_DIRS@")
|
||||
|
||||
set(PLATFORM_C_FLAGS)
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_ARCHITECTURES "@CMAKE_OSX_ARCHITECTURES@")
|
||||
set(CMAKE_OSX_INTERNAL_ARCHITECTURES "@CMAKE_OSX_INTERNAL_ARCHITECTURES@")
|
||||
set(CMAKE_OSX_SYSROOT "@CMAKE_OSX_SYSROOT@")
|
||||
if(CMAKE_OSX_ARCHITECTURES)
|
||||
set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -arch ${CMAKE_OSX_ARCHITECTURES})
|
||||
if(CMAKE_OSX_INTERNAL_ARCHITECTURES)
|
||||
set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -arch ${CMAKE_OSX_INTERNAL_ARCHITECTURES})
|
||||
endif()
|
||||
if(CMAKE_OSX_SYSROOT)
|
||||
set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT})
|
||||
|
||||
Reference in New Issue
Block a user