Skip to content

Commit

Permalink
Try fixing Apple cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmauro committed Jul 19, 2021
1 parent 33541e7 commit 6d09f76
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ include(GNUInstallDirs)
include(AbseilDll)
include(AbseilHelpers)

# Apple cross-compiling support takes an architecture list from
# CMAKE_OSX_ARCHITECTURES, leaves CMAKE_SYSTEM_PROCESSOR alone, and
# expects all architecture-specific logic to be conditioned within the
# source files rather than the build. This does not work for our
# hardware AES runtime support detection, so we fix
# CMAKE_SYSTEM_PROCESSOR and only support single-architecture builds.
if(CMAKE_OSX_ARCHITECTURES)
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHES)
if(NOT ${NUM_ARCHES} EQUAL 1)
message(FATAL_ERROR "Universal binaries not supported")
endif()
list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_SYSTEM_PROCESSOR)
endif()

##
## Using absl targets
Expand Down

1 comment on commit 6d09f76

@doctorpangloss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't work for me. See abseil#970 (comment)

Please sign in to comment.