]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libpng/macos-arch-fix.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libpng / macos-arch-fix.patch
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 6451fcf1b..dbd5016ca 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -63,11 +63,22 @@ option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON)
6 set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
7 set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
8
9 +# CMake currently sets CMAKE_SYSTEM_PROCESSOR to one of x86_64 or arm64 on macOS,
10 +# based upon the OS architecture, not the target architecture. As such, we need
11 +# to check CMAKE_OSX_ARCHITECTURES to identify which hardware-specific flags to
12 +# enable. Note that this will fail if you attempt to build a universal binary in
13 +# a single cmake invokation.
14 +if (APPLE AND CMAKE_OSX_ARCHITECTURES)
15 + set(TARGET_ARCH ${CMAKE_OSX_ARCHITECTURES})
16 +else()
17 + set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
18 +endif()
19 +
20 if(PNG_HARDWARE_OPTIMIZATIONS)
21
22 # set definitions and sources for arm
23 -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
24 - CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
25 +if(TARGET_ARCH MATCHES "^arm" OR
26 + TARGET_ARCH MATCHES "^aarch64")
27 set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
28 set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
29 check: (default) use internal checking code;
30 @@ -121,8 +132,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
31 endif()
32
33 # set definitions and sources for intel
34 -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
35 - CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
36 +if(TARGET_ARCH MATCHES "^i?86" OR
37 + TARGET_ARCH MATCHES "^x86_64*")
38 set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
39 set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
40 off: disable the optimizations")
41 @@ -171,8 +182,8 @@ endif()
42 else(PNG_HARDWARE_OPTIMIZATIONS)
43
44 # set definitions and sources for arm
45 -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
46 - CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
47 +if(TARGET_ARCH MATCHES "^arm" OR
48 + TARGET_ARCH MATCHES "^aarch64")
49 add_definitions(-DPNG_ARM_NEON_OPT=0)
50 endif()
51
52 @@ -183,8 +194,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
53 endif()
54
55 # set definitions and sources for intel
56 -if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
57 - CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*")
58 +if(TARGET_ARCH MATCHES "^i?86" OR
59 + TARGET_ARCH MATCHES "^x86_64")
60 add_definitions(-DPNG_INTEL_SSE_OPT=0)
61 endif()
62