summaryrefslogtreecommitdiff
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Android: Add placeholders for platform-specific compiler selectionBrad King2016-08-123-0/+25
| | | | | Add infrastructure modules to be loaded for determining a compiler selection when targeting Android platforms.
* Android: Add placeholders for platform-specific compiler settingsBrad King2016-08-127-0/+77
| | | | | Add infrastructure modules to be loaded for Clang and GNU compilers when targeting Android platforms.
* Merge topic 'update-cle-version-info'Brad King2016-08-081-4/+12
|\ | | | | | | | | e52302d6 CrayLinuxEnvironment: Add alternative methods to get version info
| * CrayLinuxEnvironment: Add alternative methods to get version infoChuck Atkins2016-08-051-4/+12
| | | | | | | | Closes: #16229
| * Merge branch 'revert-vs-clang-minsize' into releaseBrad King2016-06-171-1/+1
| |\
* | | SCO_SV: Enable so filename versioningPatrick Welche2016-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Take changes used by pkgsrc [1]: * so filename versioning requires CMAKE_SHARED_LIBRARY_SONAME_C_FLAG. [1] http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/cmake/patches/
* | | Use string(APPEND) in ModulesDaniel Pfeifer2016-07-283-3/+3
| | | | | | | | | | | | | | | | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* | | Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-146-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document these variables. Change our convention for setting these variables from: set(CMAKE_EXE_LINKER_FLAGS_INIT "...") to string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used.
* | | MSVC: Set all CMAKE_*_LINKER_FLAGS_INIT directlyBrad King2016-07-131-28/+19
| | | | | | | | | | | | Avoid copying CMAKE_EXE_LINKER_FLAGS_INIT to the others.
* | | Embarcadero: Set all CMAKE_*_LINKER_FLAGS_INIT directlyBrad King2016-07-131-9/+5
| | | | | | | | | | | | Avoid copying CMAKE_EXE_LINKER_FLAGS_INIT to the others.
* | | Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-0610-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document these variables. Change our convention for setting these variables from: set(CMAKE_C_FLAGS_INIT "...") to string(APPEND CMAKE_C_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used. Automate the conversion with: sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \ Modules/Compiler/*.cmake Modules/Platform/*.cmake and follow up with some manual fixes (e.g. to cases that already meant to append). Also revert the automated changes to contexts that are not protected from running multiple times.
* | | OpenWatcom: Partially modernize platform information modulesBrad King2016-07-065-0/+24
| | | | | | | | | | | | | | | | | | | | | Migrate from the old `<os>-<cc>.cmake` layout to the modern `<os>-<id>-<lang>.cmake` layout. Keep settings common to C and C++ in a `Windows-OpenWatcom.cmake` helper module with an include blocker. For now just add both C and CXX settings in the helper module.
* | | Intel: Do not use MSVC-like flags for FortranBrad King2016-07-051-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach `Modules/Platform/Windows-MSVC.cmake` not to use MSVC options for Fortran. We use the `__windows_compiler_msvc` for the Intel Fortran compiler on Windows for other settings, but we do not want the flags. Previously this worked only because the options were later overridden by `Modules/Platform/Windows-Intel*.cmake`, but it is cleaner to not set the options in the first place.
* | | Merge topic 'aix-clang'Brad King2016-06-212-0/+2
|\ \ \ | | | | | | | | | | | | | | | | 5cc34162 AIX: Add support for Clang compiler
| * | | AIX: Add support for Clang compilerWu Zhao2016-06-202-0/+2
| | | | | | | | | | | | | | | | | | | | The platform information module for GNU on AIX can be reused for Clang on AIX because clang accepts almost all of the same options.
* | | | Merge topic 'revert-vs-clang-minsize'Brad King2016-06-201-1/+1
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| 78249be2 VS: Fix regressed mapping for the cl `/Os` compiler flag
| * | VS: Fix regressed mapping for the cl `/Os` compiler flagBrad King2016-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit v3.6.0-rc1~279^2~10 (VS: in Clang/C2 toolset, setup correct compiler settings, 2016-02-18) a flag mapping was added for the clang `-Os` flag. However, this collides with a mapping we already had for the MSVC flag of the same name. This is a symptom of a larger problem in that the VS generators need a per-toolset flag map (issue #16153). For now, simply drop the new mapping and drop `-Os` from clang compiler flags in the MinSizeRel configuration. Reported-by: Felix Bruns <felixbruns@gmail.com>
* | | Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-103-2/+5
| | | | | | | | | | | | | | | | | | | | | Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the ``FIND_LIBRARY_USE_LIB64_PATHS`` property. This helps find commands on multilib systems that use ``lib32`` directories and either do not have ``lib`` symlinks or point ``lib`` to ``lib64``.
* | | Merge topic 'SunOS-PathScale'Brad King2016-06-074-0/+37
|\ \ \ | | |/ | |/| | | | | | | fcfe121f Platform: add flag definitions for PathScale compiler on SunOS (#16135)
| * | Platform: add flag definitions for PathScale compiler on SunOS (#16135)Michał Górny2016-06-064-0/+37
| |/
* | Modules: Rename internal platform-specific compiler determination modulesBrad King2016-06-024-0/+0
|/ | | | | | | Rename Modules/Platform/<os>-<lang>.cmake files to Modules/Platform/<os>-Determine-<lang>.cmake to clarify their role. For compatibility with user-provided modules, load the old names if they exist.
* OS X: Drop warning about SDK and deployment target version mismatchBrad King2016-05-261-10/+0
| | | | | | | | | OS X supports using the SDK for any version equal to or newer than the deployment target. There is no reason to warn if the versions do not match exactly. Suggested-by: James Burgess <jamesrburgess@mac.com> Suggested-by: Clinton Stimpson <clinton@elemtech.com>
* AIX,HP: Allow user to override the default runtime path (libpath)Matthew Hanna2016-05-172-2/+6
| | | | | | | | | The `CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH` is used by CMake to always append `-Wl,-blibpath:/usr/lib:/lib` to the link line. This is needed by default on these platforms but needs to be overridden in some use cases (e.g. an environment in which one maintains versioned shared libraries). Change our logic to set this value only if it not already set by the user, project, or toolchain file.
* MSVC: Drop space in `/DNDEBUG` flag for consistency (#16052)Brad King2016-04-072-9/+9
| | | | | | | | We define `NDEBUG` without a space after the `-D` option for most compilers. Remove the space for MSVC (and Intel Fortran) for consistency. The MS compiler technically does not document that the `-D` argument may be separated from its value, though every version to date supports it.
* Fix spelling typos in comments and documentation (#16037)Felix Geyer2016-03-292-2/+2
| | | | | The Debian package checker tool (lintian) detected several typos in CMake.
* ASM: Add missing <INCLUDES> placeholder for "compile" rulesGregor Jasny2016-03-292-2/+2
| | | | | | | | This placeholder was added to the compilation rules for other languages by commit v3.4.0-rc1~342^2 (Factor an <INCLUDES> placeholder out of <FLAGS> in rule variables, 2015-07-13) but ASM was incorrectly left out. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Cygwin: Add support for Clang compilerHan Sangjin2016-03-102-0/+2
| | | | | The platform information module for GNU on CYGWIN can be reused for Clang on CYGWIN because clang accepts almost all of the same options.
* Merge topic 'remove-vs6-generator'Brad King2016-03-102-7/+0
|\ | | | | | | | | | | b42866a3 Drop Visual Studio 6 generator cd9ba3ec cmLocalVisualStudio7Generator: Fix name of helper function
| * Drop Visual Studio 6 generatorBrad King2016-03-092-7/+0
| | | | | | | | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* | Merge topic 'clang-iframework-version'Brad King2016-03-101-1/+1
|\ \ | | | | | | | | | | | | 63c4133b OS X: Use -iframework with Clang only on version >= 3.2
| * | OS X: Use -iframework with Clang only on version >= 3.2Jean-Christophe Fillion-Robin2016-03-091-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.1.0-rc1~564^2 (OS X: Use -iframework for system framework directories, 2014-05-05) we test the version of Clang is smaller that 3.1 to see if it supports -iframework. Considering that "iframework" support has been added in clang@r142418 (Frontend: Support -iframework.) prior to clang 3.1, this made sense. That said, considering that support for multiple -iframework parameters has been added later in clang@r164607 (-iframework should allow separate arguments. ) prior to clang 3.2, this commit updates the check to enable framework support only if version is >= 3.2