summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'android-info-variables'Brad King2016-11-173-2/+29
|\ | | | | | | | | | | | | f7c5e970 Android: Add CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE d95e6dff Android: Add CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG variable 3d42a72b Android: Always set CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION
| * Android: Add CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINEBrad King2016-11-143-0/+11
| | | | | | | | | | | | | | | | Expose the binutils' machine name (typically used as a prefix on the tool names) publicly. This is expected to match the `gcc -dumpmachine` value. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
| * Android: Add CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG variableBrad King2016-11-143-0/+4
| | | | | | | | | | | | | | | | | | The NDK provides prebuilt toolchain files in directories named for the host architecture. The NDK build system calls this `HOST_TAG`. Expose the value publicly for use by clients that need to pass it to external tools. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
| * Android: Always set CMAKE_ANDROID_NDK_TOOLCHAIN_VERSIONBrad King2016-11-143-2/+14
| | | | | | | | | | | | | | | | | | When this variable is not set by the user or toolchain file, set it to the default selected. This will be useful for client code that needs to pass the value to an external tool that needs to find the same toolchain in the NDK. Leave it empty for a standalone toolchain. Suggested-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
* | MSVC: Do not define _DEBUG explicitly when using /MDdBrad King2016-11-151-2/+2
|/ | | | | | | | With the latter flag the compiler automatically defines `_DEBUG`: https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx Closes: #16430
* Merge topic 'vs_targets_file_as_library'Brad King2016-11-111-0/+1
|\ | | | | | | | | 883bd34a VS: Treat libraries ending in `.targets` as msbuild imports
| * VS: Treat libraries ending in `.targets` as msbuild importsSoji Yamakawa2016-11-091-0/+1
| | | | | | | | | | | | | | Generate `<Import Project="..." .../>` to import the `.targets` files into `.vcxproj` files. Closes: #16340
* | Add Fuchsia platform modulePetr Hosek2016-11-091-0/+25
| | | | | | | | | | Fuchsia is a new operating system. This module provides a minimal setup needed to use Fuchsia toolchain.
* | Merge topic 'fix-macos-sysroot'Brad King2016-11-022-30/+2
|\ \ | |/ |/| | | | | | | 93504190 Darwin: Remove deployment target version check 542d52f9 Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path"
| * Darwin: Remove deployment target version checkGregor Jasny2016-11-012-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Revert "Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path"Gregor Jasny2016-11-011-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit v3.7.0-rc1~48^2 (Xcode: Convert maybe unversioned OSX sysroot into versioned SDK path, 2016-09-25). The replacement of `else()` with `if(CMAKE_OSX_SYSROOT)` defeats the prior handling of `if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")`. This causes the combination -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" -DCMAKE_OSX_SYSROOT:STRING=/ to not be honored and `-isysroot` to be emitted as a compiler flag universally. We will need another solution to the problem the now-reverted commit was meant to address. Closes: #16394
* | Merge topic 'android-pic'Brad King2016-10-2515-35/+9
|\ \ | | | | | | | | | | | | | | | 4c272adb Android: Link position-independent executables with proper flags 6205f179 Android: Set CMAKE_POSITION_INDEPENDENT_CODE automatically
| * | Android: Link position-independent executables with proper flagsBrad King2016-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add `-fPIE -pie` to the default executable link flags when `CMAKE_POSITION_INDEPENDENT_CODE` is enabled. This is required by Android 16 and above for executables to run on the device. Closes: #16382
| * | Android: Set CMAKE_POSITION_INDEPENDENT_CODE automaticallyBrad King2016-10-2415-35/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the toolchain file or cache does not set this, enable it automatically based on the Android API version. Versions 16 and above expect position independent code. Use the main `CMAKE_POSITION_INDEPENDENT_CODE` setting in favor of hard-coding `-fpic` or `-fPIC` in the compiler flags for each ABI. This allows CMake to use `-fpie` or `-fPIE` as needed when sources are meant for executables, and `-fpic` or `-fPIC` for other sources.
* | | Merge topic 'android-link-exe'Brad King2016-10-244-0/+16
|\ \ \ | |/ / | | | | | | | | | 295c8efa Android: Add missing link flags for device executables
| * | Android: Add missing link flags for device executablesBrad King2016-10-214-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | See `${ndk}/build/core/default-build-commands.mk` for link flags the NDK uses for executables. Add them to our default executable link flags. Suppress `nocopyreloc` on `arm64-v8a` because it does not work with some STL types. Closes: #16380
* | | Merge topic 'android-armeabi-c++_static'Brad King2016-10-211-0/+2
|\ \ \ | |/ / | | | | | | | | | 43f4326e Android: Fix support for armeabi with c++_static
| * | Android: Fix support for armeabi with c++_staticBrad King2016-10-211-0/+2
| |/ | | | | | | | | | | | | | | Add missing "unwind" and "atomic" libraries needed for this combination. See `${ndk}/sources/cxx-stl/llvm-libc++/libs/armeabi/libc++.a` for the libraries the NDK uses. Issue: #16380
| * Merge branch 'fix-Android-NsightTegra' into releaseBrad King2016-10-181-1/+1
| |\
| * \ Merge branch 'osx-no-deployment-target-on-cross-compile' into releaseBrad King2016-10-171-1/+1
| |\ \
* | \ \ Merge topic 'fix-Android-NsightTegra'Brad King2016-10-191-1/+1
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 9af881d8 Tests: Add VSNsightTegra test for VS 2015 6739d240 Tests: Fix VSNsightTegra test on Android NDK r12b 06c39612 VS: Fix NVIDIA Nsight Tegra Visual Studio Edition support
| * | | VS: Fix NVIDIA Nsight Tegra Visual Studio Edition supportBrad King2016-10-181-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The guard added by commit v3.7.0-rc1~229^2~17 (Android: Suppress new functionality with Nsight Tegra in VS IDE builds, 2016-06-02) to `Modules/Platform/Android-Determine.cmake` does not work in that location because `CMAKE_VS_PLATFORM_NAME` is not set until after the module is loaded. Change this particular guard to test for the Visual Studio generator instead. If in the future we add support for using Visual Studio for Android without Nsight Tegra then something more will be needed, but this is good enough for now. Closes: #16371
* | | Merge topic 'osx-no-deployment-target-on-cross-compile'Brad King2016-10-171-1/+1
|\ \ \ | | |/ | |/| | | | | | | e8bafb6f OS X: Do not try to set deployment target when cross-compiling
| * | OS X: Do not try to set deployment target when cross-compilingGregor Jasny2016-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit v3.4.0-rc2~6^2 (Xcode: Adjust deployment target SDK version to host version, 2015-10-11) does not make sense when cross-compiling. Make it conditional to fix this regression in some cross-compiling cases. Closes: #16355
* | | Merge topic 'remove-obsolete'Brad King2016-10-131-2/+0
|\ \ \ | |_|/ |/| | | | | | | | | | | b6a174d2 Makefiles: Remove query for CMAKE_OBJECT_NAME d0faa58a Makefiles: Remove forbidden flag logic
| * | Makefiles: Remove forbidden flag logicStephen Kelly2016-10-091-2/+0
| | | | | | | | | | | | This might have been needed some day in the past, but not anymore.
* | | Android: Fix support for cxxabi.h with libc++Brad King2016-10-071-0/+2
|/ / | | | | | | | | | | Additional include directories are needed for this on some STL types. Closes: #16350
* | Android: Update libc++ include directories for NDK r13Brad King2016-10-061-1/+7
|/ | | | | | The Android NDK r13 moved the libc++ include directories. Closes: #16346
* Merge topic 'vs-clang-llvm-support'Brad King2016-09-291-2/+2
|\ | | | | | | | | 3f300b84 VS: Recognize VS/LLVM toolset names as Clang
| * VS: Recognize VS/LLVM toolset names as ClangRoman Wüger2016-09-281-2/+2
| | | | | | | | | | | | Update the toolset name matching added by commit v3.6.0-rc1~279^2~10 (VS: in Clang/C2 toolset, setup correct compiler settings, 2016-02-18) to match VS/LLVM toolset names too.
* | Simplify CMake per-source license noticesBrad King2016-09-2766-825/+132
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Xcode: Convert maybe unversioned OSX sysroot into versioned SDK pathGregor Jasny2016-09-251-2/+4
| | | | | | | | | | | | | | | | | | Starting with Xcode 8 the SDK folder also contains an unversioned entry: $ ls -l /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs drwxr-xr-x 5 root wheel 170 Mar 4 2018 MacOSX.sdk lrwxr-xr-x 1 root wheel 10 Sep 16 20:49 MacOSX10.12.sdk -> MacOSX.sdk If this unversioned path is used CMake cannot detect the SDK version. To work around the problem we always invoke the code path that translates short SDK names like "macosx10.12" into a path. That way we always end up with a versioned SDK path in _CMAKE_OSX_SYSROOT_PATH which is later used to determine the version. Closes: #16323
* GNU: Do not use -fvisibility on AIX or HP-UXBrad King2016-09-054-0/+4
| | | | | | Use of `-fvisibility=hidden` warns: warning: visibility attribute not supported in this configuration; ignored
* Android: Add `ANDROID` variable to indicate the targetBrad King2016-08-231-0/+2
| | | | | Allow projects to use `if(ANDROID)` to condition their Android-specific code paths.
* Android: Select the STL type for NDK buildsBrad King2016-08-2315-0/+184
| | | | | | | Populate standard include directories and link libraries for the platform. Select the STL corresponding to CMAKE_ANDROID_STL_TYPE and matching the current ABI and toolchain to be used. Refer to the NDK sources/cxx-stl/*/Android.mk files for the needed file locations.
* Android: Populate compiler flags for current ABIBrad King2016-08-2317-0/+192
| | | | | Initialize the CMAKE_{C,CXX}_FLAGS{,_<CONFIG>} cache entries with flags for each ABI as specified by NDK toolchain `setup.mk` files.
* Android: Add a CMAKE_BUILD_TYPE defaultBrad King2016-08-121-0/+2
| | | | | | Android NDK builds are always `debug` or `release`. We may populate flags for these configurations that are needed to produce compatible binaries. Ensure they are used by default.
* Android: Add Clang -target option for current ABIBrad King2016-08-129-0/+17
|
* Android: Add placeholders for compiler/abi-specific settingsBrad King2016-08-1221-0/+38
| | | | | | | | | | The Android NDK source repository at https://android.googlesource.com/platform/ndk.git has `<ndk>/build/core/toolchains/*/setup.mk` files that store tables of information for their build system. Add an equivalent file for each compiler/abi combination.
* Android: Avoid interfering with common pre-existing toolchain filesBrad King2016-08-125-0/+36
| | | | | | | | | Commonly used Android toolchain files that pre-date CMake upstream support may need to be updated to work with our new functionality. They typically set CMAKE_SYSTEM_VERSION to 1, so detect that and skip our upstream Android settings. When such toolchain files are updated to account for our upstream support, they can then set CMAKE_SYSTEM_VERSION to a valid Android API and get new behavior.
* Android: Search for NDK and standalone toolchain in more placesBrad King2016-08-121-0/+8
| | | | | | Commonly used Android toolchain files that pre-date CMake upstream support use a few environment and CMake variables as search locations. Use them too to aid transition.
* Android: Detect and save a standalone toolchain without the NDKBrad King2016-08-124-5/+115
|
* Android: Detect settings from the CMAKE_SYSROOT if it is setBrad King2016-08-121-1/+68
|
* Android: Detect and save a toolchain from the NDKBrad King2016-08-122-0/+296
|
* Android: Set CMAKE_SYSROOT automaticallyBrad King2016-08-121-0/+19
| | | | | | Compute CMAKE_SYSROOT automatically for the current API and architecture selection. This causes the --sysroot option to be passed to GNU and Clang compilers.
* Android: Detect and save the architecture, ABI, and processorBrad King2016-08-121-1/+88
| | | | | Add new CMakeSystem.cmake entries for the architecture and ABI. Store the processor in CMAKE_SYSTEM_PROCESSOR.
* Android: Detect and save the API levelBrad King2016-08-121-0/+48
| | | | | | Store the Android API level in CMAKE_SYSTEM_VERSION. If it is not provided by the user, initialize it from CMAKE_ANDROID_API or fall back to finding the latest available in the NDK.
* Android: Detect and save the NDK directoryBrad King2016-08-121-0/+27
| | | | Add a new CMakeSystem.cmake entry for the NDK location.
* Android: Suppress new functionality with Nsight Tegra in VS IDE buildsBrad King2016-08-125-0/+41
| | | | | | Support for NVIDIA Nsight Tegra Visual Studio Edition was previously implemented in the CMake VS IDE generators. Avoid interfering with that functionality for now. Later we may try to integrate this.
* Android: Add placeholders for platform-specific initializationBrad King2016-08-122-0/+29
| | | | | Add infrastructure modules to be loaded when initializing builds targeting Android platforms.