Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
78f96802
Unverified
Commit
78f96802
authored
Jan 07, 2022
by
Andrei Polushin
Committed by
GitHub
Jan 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macos: support Apple Universal 2 builds (#1086)
fixes #970
parent
4799f622
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletions
+43
-1
absl/copts/AbseilConfigureCopts.cmake
+43
-1
No files found.
absl/copts/AbseilConfigureCopts.cmake
View file @
78f96802
...
@@ -12,7 +12,49 @@ else()
...
@@ -12,7 +12,49 @@ else()
set
(
ABSL_BUILD_DLL FALSE
)
set
(
ABSL_BUILD_DLL FALSE
)
endif
()
endif
()
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"x86_64|amd64|AMD64"
)
if
(
APPLE AND CMAKE_CXX_COMPILER_ID MATCHES
[[Clang]]
)
# Some CMake targets (not known at the moment of processing) could be set to
# compile for multiple architectures as specified by the OSX_ARCHITECTURES
# property, which is target-specific. We should neither inspect nor rely on
# any CMake property or variable to detect an architecture, in particular:
#
# - CMAKE_OSX_ARCHITECTURES
# is just an initial value for OSX_ARCHITECTURES; set too early.
#
# - OSX_ARCHITECTURES
# is a per-target property; targets could be defined later, and their
# properties could be modified any time later.
#
# - CMAKE_SYSTEM_PROCESSOR
# does not reflect multiple architectures at all.
#
# When compiling for multiple architectures, a build system can invoke a
# compiler either
#
# - once: a single command line for multiple architectures (Ninja build)
# - twice: two command lines per each architecture (Xcode build system)
#
# If case of Xcode, it would be possible to set an Xcode-specific attributes
# like XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=arm64] or similar.
#
# In both cases, the viable strategy is to pass all arguments at once, allowing
# the compiler to dispatch arch-specific arguments to a designated backend.
set
(
ABSL_RANDOM_RANDEN_COPTS
""
)
foreach
(
_arch IN ITEMS
"x86_64"
"arm64"
)
string
(
TOUPPER
"
${
_arch
}
"
_arch_uppercase
)
string
(
REPLACE
"X86_64"
"X64"
_arch_uppercase
${
_arch_uppercase
}
)
foreach
(
_flag IN LISTS ABSL_RANDOM_HWAES_
${
_arch_uppercase
}
_FLAGS
)
list
(
APPEND ABSL_RANDOM_RANDEN_COPTS
"-Xarch_
${
_arch
}
"
"
${
_flag
}
"
)
endforeach
()
endforeach
()
# If a compiler happens to deal with an argument for a currently unused
# architecture, it will warn about an unused command line argument.
option
(
ABSL_RANDOM_RANDEN_COPTS_WARNING OFF
"Warn if one of ABSL_RANDOM_RANDEN_COPTS is unused"
)
if
(
ABSL_RANDOM_RANDEN_COPTS AND NOT ABSL_RANDOM_RANDEN_COPTS_WARNING
)
list
(
APPEND ABSL_RANDOM_RANDEN_COPTS
"-Wno-unused-command-line-argument"
)
endif
()
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"x86_64|amd64|AMD64"
)
if
(
MSVC
)
if
(
MSVC
)
set
(
ABSL_RANDOM_RANDEN_COPTS
"
${
ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
}
"
)
set
(
ABSL_RANDOM_RANDEN_COPTS
"
${
ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
}
"
)
else
()
else
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment