| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Some declarations were inconsistent.
For example, "LINKER:-force_load <LIBRARY>" was translated to
"-Xlinker -force_load /path/to/library". The correct translation
should be "-Xlinker -force_load -Xlinker /path/to/library" because
the library is an argument to the -force_load option.
|
| |
|
|
|
|
|
|
|
|
| |
Set target platform identification variables like `APPLE` and `LINUX`
as soon as the target system is identified. This makes them available
during toolchain and binutils selection.
Fixes: #23333
|
|
|
|
| |
Fixes: #24123
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
To be more consistent between genex and variables as well as
the forecomming LINK_GROUP genex, rename variable *_LINK_USING_<FEATURE>*
in *_LINK_LIBRARY_USING_<FEATURE>*
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 4aed96e230 (Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG
on non-macOS too, 2021-04-06, v3.20.1~5^2) we always enable support for
linking with `-rpath`. The intention of the change was to enable using
the flag on iOS, tvOS and watchOS by avoiding a Darwin-specific version
check. However, removing the check broke support for OS X 10.4 because
the flag is not supported on that version.
Restore a form of the check that disables the flag on OS X < 10.5 while
still allowing it for the other Apple platforms. Since no one is doing
iOS/tvOS/etc development on 10.4, this change should have no unintended
side effects.
Fixes: #22490
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since CMake 3.19, we no longer support macOS SDKs older than 10.5,
which corresponds to Xcode 3. Supporting older Xcode versions for
device platforms is also not realistic. We therefore expect the -rpath
linker option should always be supported now.
When targeting iOS, tvOS or watchOS, the previous disabling of -rpath
support meant that the install_name_dir of shared libraries and
frameworks was unable to use @rpath. This resulted in embedding
absolute paths for their install_name. When they were embedded in an
app bundle, this would cause the app to fail at runtime. By enabling the
-rpath linker option, the default install_name_dir is now @rpath for these platforms, which results in binaries that do work at runtime.
Fixes: #20036
|
|
|
|
|
|
|
| |
According to https://brew.sh/2020/12/01/homebrew-2.6.0/ the `/opt/homebrew`
directory is recommended for installing ARM architecture brew packages.
Fixes: #21585
|
|
|
|
|
|
|
| |
The libraries in the SDK should be given precedence over the system
libraries. Check for the default library search path (in default order)
of `/usr/lib` and `/usr/local/lib` and use these as system prefix paths
for libraries when performing the link step against a specified SDK.
|
|
|
|
|
|
|
|
| |
Populate `CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES` with the macOS SDK's
include directory so that we filter such implicit directories out of
Swift targets.
Fixes: #19845
|
|
|
|
| |
Update CMAKE_SYSTEM_FRAMEWORK_PATH with new Xcode 11 frameworks directory
|
|
|
|
| |
Fixes: #19928
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add entries in Modules and Modules/Platform to support
Objective-C++ compiler determination and identification.
Add Modules to check Objective-C++ compiler flags, source
compilations, program checks, etc...
Use OBJCXX as the designator of the language, eg:
project(foo OBJCXX)
Add various tests for Objective-C++ language features. Add
tests to preserve C++ handling of .M and .mm files when
Objective-C++ is not a configured language.
Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add entries in Modules and Modules/Platform to support
Objective-C compiler determination and identification.
Add Modules to check Objective-C compiler flags, source
compilations, program checks, etc...
Use OBJC as the designator of the language, eg:
project(foo OBJC)
Add various tests for Objective-C language features. Add
tests to preserve C++ handling of .m and .mm files when
OBJC is not a configured language.
Co-Authored-By: Cristian Adam <cristian.adam@gmail.com>
|
|
|
|
| |
This allows overriding them in a toolchain file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY are set to "ONLY" when cross
building to iOS, but appears that CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
was overlooked.
This causes packages to be searched for in the host system as well,
which is incorrect and can lead to linking issues.
Set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to "ONLY" as well.
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM is not touched, because a user
might want to find programs / tools on the host system.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the value is hardcoded to contain only the sysroot for
the respective darwin platform. This means that it can not be changed
in a custom toolchain file.
Instead of overriding the value, simply append it. This is similar
to how it is done in the Google provided Android toolchain file.
The usecase is to allow specifying addiitonal roots to look for
3rd party packages which are definitely not present in the default
sysroot.
|
|
|
|
|
|
|
|
|
|
| |
Currently CMAKE_MACOSX_BUNDLE is always set to true when compiling
for iOS. This poses a problem when using the source file
variant of try_compile. Even if a custom value is passed via
the CMAKE_FLAGS option, it would still be overridden by the
Darwin.cmake file.
Only set the value in case no other value was provided before.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) the
`Platform/UnixPaths` module was updated to add `/usr/include` to
`CMAKE_{C,CXX,CUDA}_IMPLICIT_INCLUDE_DIRECTORIES` through an
initialization variable used by `CMakeDetermineCompilerABI` instead of
directly. This approach makes it only a default that can be overridden
by detection of the implicit include directories really used by the
compiler.
The addition of `<sdk>/usr/include` to default implicit include
directories by the `Platform/Darwin` module needs the same update but
was accidentally left out of the original commit.
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove code signing requirements for non-macOS
- Do not set deployment target for non-macOS
- Build static library for compiler feature detection for non-macOS
- Use framework to run CompilerId tests for watchOS
- Port tests to new SDK handling
- Add new Apple cross-compiling section to toolchain documentation
Closes: #17870
|
|\
| |
| |
| |
| |
| | |
93504190 Darwin: Remove deployment target version check
542d52f9 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Starting with Xcode 8 the SDK folder also contains an unversioned entry:
MacOSX.sdk
MacOSX10.12.sdk -> MacOSX.sdk
If this unversioned path is used CMake cannot detect the SDK version.
Furthermore, querying the SDK version via
xcodebuild -sdk <sysroot> -version Path
gives bogus results for the Command Line Tools installed into `/`.
The OS X deployment target version and SDK version are not as tied as
they once were, so this check is now more trouble than it is worth.
Simply remove it.
Closes: #16323
|
|/
|
|
| |
This might have been needed some day in the past, but not anymore.
|
|
|
|
|
|
|
|
| |
Starting with Xcode 7 the OSX and iOS SDKs contain only stub
files for dynamic system libraries. These stub files contain
some meta data and a list of exported sysbols in plain text.
They are handled by the toolchain like regular dylibs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Xcode 5 platform specific framework locations differ from the Xcode
6 ones. Look first for the Xcode 6 ones, then for iOS Xcode 5 ones and
last for the Xcode 5 OS X ones.
For reference, the XCTest.framework is located as follows:
Xcode511.app/Contents/Developer/Library/Frameworks/XCTest.framework
Xcode511.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/Developer/Library/Frameworks/XCTest.framework
Xcode511.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Developer/Library/Frameworks/XCTest.framework
Xcode601.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework
Xcode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework
Xcode601.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise find_library is unable to lookup the XCTest framework which
is not located in the SDK serach path:
In the 10.10 SDK the SDK frameworks are located here:
$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks
whereas the Platform SDKs are located here:
$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/Library/Frameworks
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
|
|
|
|
|
|
|
|
| |
Allow the combination
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.8" -DCMAKE_OSX_SYSROOT="/"
to work. Treat the "/" sysroot as targeting the current OS X version.
|
|\
| |
| |
| |
| | |
Resolve conflict in Source/cmGlobalGenerator.cxx by integrating
changes from both sides.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
All these expressions work the same:
"foo"
".*foo.*"
"^.*foo.*$"
This assumes that the "Intel*" expressions were meant to be "Intel.*".
|
|/
|
|
|
|
| |
Initialize variables CMAKE_OSX_SYSROOT, CMAKE_OSX_DEPLOYMENT_TARGET, and
CMAKE_OSX_ARCHITECTURES prior to enabling any languages. This will
allow compiler identification to consider these values.
|
|
|
|
|
| |
In "Modules/Platform/Darwin.cmake" the variable _apps_paths stays empty
if cross compiling. Do not de-duplicate an empty list.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so. In the error suggest using a CMake 2.8.x release.
Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4. They are not supported by CMake >= 3.0.
Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
|
|
|
|
|
|
|
|
|
| |
Compilers for languages other than C and C++ on OS X may not understand
the -F framework search flag. Create a new platform information
variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it
for C and CXX lanugages in the Platform/Darwin module.
Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
|
|
|
|
|
|
|
|
| |
In Modules/Platform/Darwin.cmake set CMAKE_SYSTEM_FRAMEWORK_PATH to
include framework directories from inside the system SDK corresponding
to CMAKE_OSX_SYSROOT.
Suggested-by: Sean McBride <sean@rogue-research.com>
|
|
|
|
|
|
|
| |
Since commit 95f78e08 (OS X: Search for SDK based on deployment target,
2013-08-02) we select the default OS X SDK path to match the deployment
target. Fix this behavior in the case that the matching SDK does not
exist and fall back to the SDK for the current host OS X version.
|
|
|
|
|
|
|
|
|
|
| |
Teach modules CMakeDetermineCompiler and CMakeUnixFindMake to ask Xcode
where to find the compiler or make tools, using 'xcrun --find', if none
is found in the PATH. Teach module Platform/Darwin to add the path to
the SDK to CMAKE_SYSTEM_PREFIX_PATH so that find_* command look there.
Also add the SDK /usr/include directory to the implicit include list in
CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to suppress explicit -I
options for it.
|
|
|
|
|
|
|
|
| |
When available, use CMAKE_OSX_DEPLOYMENT_TARGET instead of the host OS X
version to select the default SDK. This makes sense because one should
use the SDK matching the deployment target.
Suggested-by: John Ralls <jralls@ceridwen.us>
|
|
|
|
|
|
|
|
|
| |
RPATH support is activated on targets that have the MACOSX_RPATH
property turned on.
For install time, it is also useful to set INSTALL_RPATH to help
find dependent libraries with an @rpath in their install name.
Also adding detection of rpath conflicts when using frameworks.
|
|
|
|
|
| |
Add a post-build command to shared library targets to create the
versioning symbolic links.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we hard-coded a list of implicit framework directories but
did not account for CMAKE_OSX_SYSROOT or for changes to the list across
OS X versions. Instead we should automatically detect the framework
directories for the active toolchain.
The parent commit added the "-Wl,-v" option to ask "ld" to print its
implicit directories. It displays a block such as:
Framework search paths:
/...
Parse this block to extract the list of framework directories.
Detection may fail on toolchains that do not list their framework
directories, such as older OS X linkers. Always treat the paths
<sdk>/Library/Frameworks
<sdk>/System/Library/Frameworks
<sdk>/Network/Library/Frameworks # Older OS X only
/System/Library/Frameworks
as implicit. Note that /System/Library/Frameworks should always be
considered implicit so that frameworks CMake finds there will not
override the SDK copies.
|
|
|
|
|
|
|
| |
Xcode 3.2.6 is known to break the SDK Library/Frameworks layout.
Detect and warn about this case to tell users to fix their system.
Reported-by: Matthew Brett <matthew.brett@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 43b74793 (OS X: Further improve default CMAKE_OSX_SYSROOT
selection, 2012-09-21) we choose a default CMAKE_OSX_SYSROOT only when
one is needed. However, the change forgot that we require a sysroot
when a deployment target is requested. Teach Darwin.cmake to choose a
default CMAKE_OSX_SYSROOT when CMAKE_OSX_DEPLOYMENT_TARGET is set.
Reported-by: Matthew Brett <matthew.brett@gmail.com>
Reported-by: Bradley Giesbrecht <pixilla@macports.org>
|
|
|
|
|
|
|
|
|
| |
Since commit 1786b121 (OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK
name, 2012-09-21) we support names like "macosx" or "macosx10.7" as the
specified value of CMAKE_OSX_SYSROOT. Extend the SDK name->path
conversion to save the original value and also convert into a temporary
variable for the Xcode generator. Re-implement the deployment target
sanity check to detect the version from the transformed path.
|
|
|
|
|
|
|
|
|
| |
Since commit 230ea218 (OS X: Improve default CMAKE_OSX_SYSROOT
selection, 2012-09-21) we always set CMAKE_OSX_SYSROOT if any SDK is
found in order to support Makefile generator builds with Xcode >= 4.3
without the command-line tools installed. However, in the basic
POSIX-only case of the Makefile generator with command-line tools and no
CMAKE_OSX_ARCHITECTURES we should not select any SDK by default.
|