summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fix-qcc-compiler-id'Brad King2015-01-161-1/+1
|\ | | | | | | | | 9c9bc712 QNX: Fix detection of QCC compiler id (#15349)
| * QNX: Fix detection of QCC compiler id (#15349)Brad King2015-01-141-1/+1
| | | | | | | | | | | | | | In commit v3.1.0-rc1~113^2 (Use a more reliable regex for extracting binary INFO strings, 2014-09-03) the matching of INFO: strings was made more strict and no longer matches just "INFO:qnxnto". Use "INFO:qnxnto[]" instead to conform to the new pattern.
* | Merge topic 'xcode-ios-compiler-id'Brad King2015-01-121-5/+0
|\ \ | | | | | | | | | | | | 7b7209f6 Xcode: Do not require code signing for compiler id (#15214)
| * | Xcode: Do not require code signing for compiler id (#15214)Brad King2015-01-111-5/+0
| |/ | | | | | | | | | | | | | | The approach in commit v3.1.0-rc1~1^2 (Xcode: Fix compiler id detection when code signing is required, 2014-10-22) still requires a code signing key when targeting a real device. Instead set CODE_SIGNING_REQUIRED to "NO" to tell Xcode not to sign at all. Drop the corresponding setting of the code signing identity.
* | Merge topic 'xcode-ios-compiler-id'Brad King2014-11-101-1/+1
|\ \ | |/ | | | | | | 7f89552a Xcode: Fix compiler path detection for iOS tools on Xcode <= 5.0 (#15237)
| * Xcode: Fix compiler path detection for iOS tools on Xcode <= 5.0 (#15237)Brad King2014-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since commit v3.1.0-rc1~1^2~1 (Xcode: Fix compiler id detection for iOS tools, 2014-10-22) our compiler id detection project sets the product type to 'com.apple.product-type.bundle.unit-test'. This causes the Ld command line on which we match the path to the compiler to have a 'CompilerIdC.xctest/' component. The commit updated our regex to match this, but placed it before the extra './' component that Xcode 5.0 and below produce. Xcode <= 5.0 prints '/./CompilerIdC.xctest/', so switch the order of the two components in the regex to match it.
* | Merge topic 'xcode-ios-compiler-id'Brad King2014-10-231-2/+17
|\ \ | |/ | | | | | | | | b91020f6 Xcode: Fix compiler id detection when code signing is required c48f6e12 Xcode: Fix compiler id detection for iOS tools (#15214)
| * Xcode: Fix compiler id detection when code signing is requiredBrad King2014-10-221-0/+5
| | | | | | | | | | | | | | | | | | | | The iOS product type 'com.apple.package-type.bundle.unit-test' requires code signing on Xcode 6. Other iOS target types do too. Until CMake learns to add the CODE_SIGN_IDENTITY build attribute itself, toolchain files can set CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY to tell the Xcode generator to add the attribute. Teach CMakeDetermineCompilerId to recognize this variable and add the CODE_SIGN_IDENTITY build attribute to the compiler id project.
| * Xcode: Fix compiler id detection for iOS tools (#15214)Brad King2014-10-221-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 0cce556b (Xcode: Use sysroot and deployment target to identify compiler, 2014-04-29) our compiler id detection project uses the target platform SDK in case Xcode selects a different compiler based on it. Now the compiler id project actually compiles with the target compiler and SDK when cross-compiling. The iOS tools do not support the 'com.apple.product-type.tool' product type we use in our compiler id detection project. When targeting iPhone, use product type 'com.apple.product-type.bundle.unit-test' instead.
* | Avoid if() quoted auto-dereferenceBen Boeckel2014-10-201-1/+1
|/ | | | | | | When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly dereference or quote the variable. We want if() to auto-dereference the variable and not its value. Also replace MATCHES with STREQUAL where equivalent.
* VS: Detect compiler id of Nsight Tegra-Android toolchainsBrad King2014-09-291-4/+18
| | | | | | | | | | Teach CMakeDetermineCompilerId to recognize the Tegra-Android platform and generate a test project for Nsight Tegra tools. Locate the full path to CMAKE_<LANG>_COMPILER by computing it within the test project build environment. Also teach CMakeFindBinUtils that this variant of the Visual Studio generator uses UNIX-like instead of MS-like archiving and linking tools.
* Use a more reliable regex for extracting binary INFO stringsChuck Atkins2014-09-031-1/+1
| | | | | | | A few different regular expressions were being used in various places to extract info strings from binaries. This uses a consistent regex amongst all of them now. This also fixes the broken ABI detection for Cray compilers.
* CMakeDetermineCompilerId: Fix detection for VS ARM platformBrad King2014-08-121-0/+5
| | | | | | | | | Add WindowsSDKDesktopARMSupport to the compiler id .vcxproj to avoid 'error MSB8022: Compiling Desktop applications for the ARM platform is not supported.' from VS. Inspired-by: Minmin Gong <minmin.gong@gmail.com> Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
* CMakeDetermineCompilerId: Recognize WindowsPhone and WindowsStoreGilles Khouzam2014-07-311-0/+12
| | | | | | | | | When CMAKE_SYSTEM_NAME is set to target one of these, add ApplicationType and ApplicationTypeRevision elements to the .vcxproj file used to identify the compiler so that the WindowsPhone or WindowsStore toolchains can work. Co-Author: Brad King <brad.king@kitware.com>
* CompilerId: Guard the platform-default compiler code with a parameter.Stephen Kelly2014-05-071-0/+1
|
* CompilerId: Allow specifying the compiler-specific components to generate.Stephen Kelly2014-05-071-1/+4
|
* Project: Split the compiler id detection into a separate function.Stephen Kelly2014-05-071-74/+2
| | | | | This can be extended with parameters to control the output and re-used in other contexts.
* Project: Generate the CXX compiler Id test from multiple files.Stephen Kelly2014-05-071-0/+77
| | | | | | This will allow sharing of the logic of the order to test compilers in and the preprocessor macros used to do that and to determine the version components.
* Merge branch 'master' into osx-init-earlyBrad King2014-04-291-18/+13
|\ | | | | | | | | Resolve conflict in Source/cmGlobalGenerator.cxx by integrating changes from both sides.
| * Remove .* expressions from beginning and end of MATCHES regexsRolf Eike Beer2014-04-141-7/+7
| | | | | | | | | | | | | | | | | | All these expressions work the same: "foo" ".*foo.*" "^.*foo.*$" This assumes that the "Intel*" expressions were meant to be "Intel.*".
| * Replace string(REGEX REPLACE) with string(REPLACE) where possibleRolf Eike Beer2014-04-141-1/+1
| | | | | | | | The simple replacement is much faster.
| * Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)Rolf Eike Beer2014-04-141-10/+5
| | | | | | | | | | | | The matches have already been calculated and can simply be taken from CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very similar regular expressions.
* | Xcode: Use sysroot and deployment target to identify compilerBrad King2014-04-291-0/+11
|/ | | | | | | | Use CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET to set the Xcode SDKROOT and MACOSX_DEPLOYMENT_TARGET build settings. This is necessary because some versions of Xcode select a different compiler based on these settings. We need to make sure the compiler identified during language initialization matches what will be used for the actual build.
* QNX: Introduce QCC compiler id for that QNX platform compiler.Stephen Kelly2014-01-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Introduce policy CMP0047 to control resetting the id for compatibility. De-duplicate content in the QNX platform file by including the GNU one. QNX is a form of GNU platform. Do not clear CMAKE_SHARED_LIBRARY_${lang}_FLAGS variables. They are populated again later by the Compiler/GNU.cmake file anyway. Modify the CMAKE_CXX_COMPILE_OBJECT variable only when the QCC compiler id is in use, and the language is CXX. Use the QNX recommended flag for QCC instead of the gcc compatible -x flag. Populate new module files to handle system includes and depfiles when using the QCC compiler. Remove code which unsets the system include and depfiles related variables. When a GNU driver is used instead of the QCC one, the appropriate flags will be used. These variables were previously cleared for lowest-common-denominator compatibility with both drivers.
* Merge topic 'xcode-5.1'Brad King2013-12-191-1/+1
|\ | | | | | | | | 65ee85d CMakeDetermineCompilerId: Fix compiler line match for Xcode 5.1
| * CMakeDetermineCompilerId: Fix compiler line match for Xcode 5.1Ted Kremenek2013-12-091-1/+1
| | | | | | | | | | | | Xcode 5.1 output no longer puts "./" in the path to the linker output for the CompilerId test binary. Update our regex to match the path with or without the component.
* | Merge topic 'cleanup-build-commands'Brad King2013-12-051-14/+23
|\ \ | | | | | | | | | | | | | | | e420124 CMakeDetermineCompilerId: Use CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND 0c55729 VS: Add CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND variables
| * | CMakeDetermineCompilerId: Use CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMANDBrad King2013-12-041-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the code path for launching the VS IDE tools, avoid using CMAKE_MAKE_PROGRAM. Instead use the variables CMAKE_VS_DEVENV_COMMAND, CMAKE_VS_MSBUILD_COMMAND, and CMAKE_VS_MSDEV_COMMAND to lookup the location of the build tool needed. Choose the proper tool based on availability and necessity for the language (e.g. Intel Fortran must build with devenv.com and not MSBuild.exe).
* | | CMakeDetermineCompilerId: Look for internal file only on hostStephen Kelly2013-11-191-1/+1
|/ / | | | | | | | | | | | | | | | | | | The find_file this module uses to locate the compiler id source file must always look on the host and never in CMAKE_FIND_ROOT_PATH, even when a toolchain file has set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) Add NO_CMAKE_FIND_ROOT_PATH to the find_file call to avoid rerooting.
* | Drop use of configure_file IMMEDIATE optionDaniele E. Domenichelli2013-11-131-2/+2
| | | | | | | | | | | | Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08) we no longer need to use the configure_file IMMEDIATE option to support compatibility modes less than 2.0.
* | CMakeDetermineCompilerId: Load src from CMAKE_MODULE_PATH (#14481)Dragos Carp2013-10-281-1/+3
| | | | | | | | Support new languages using CMAKE_MODULE_PATH.
* | CMakeDetermineCompilerId: Always use compiler detected from IDEBrad King2013-10-281-6/+4
| | | | | | | | | | | | | | When compiler id detection also provides a CMAKE_<LANG>_COMPILER value, use it unconditionally. It is known to be the compiler that is actually in use by IDE builds in VS and Xcode. Do not let a stray cache entry try to say otherwise.
* | Quote ${CMAKE_<LANG>_COMPILER} while enabling a languageBrad King2013-10-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Even though this variable gets set to CMAKE_<LANG>_COMPILER-NOTFOUND when the compiler is not found, CMake<LANG>Compiler.cmake gets removed by cmGlobalGenerator::EnableLanguage so in try compiles the value is empty. Quote references to the variable in Modules/CMake(C|CXX|Fortran)Information.cmake Modules/CMakeDetermineCompilerId.cmake to avoid dropping arguments from commands that expect them.
* | CMakeDetermineCompilerId: Do not test vendor without a compilerBrad King2013-10-221-1/+1
| | | | | | | | | | If no CMAKE_${lang}_COMPILER is available then do not try to run it to determine the compiler vendor.
* | VS 6: Do not try Intel Fortran .vfproj file with msdevBrad King2013-10-191-1/+5
| | | | | | | | | | | | Teach CMakeDetermineCompilerId to skip trying to build a .vfproj file for Intel Fortran under Visual Studio 6. The msdev command-line build produces a popup error dialog that hangs the configuration.
* | VS: Detect Intel Fortran compiler id and versionBrad King2013-10-181-1/+5
| | | | | | | | | | | | Teach CMakeDetermineCompilerId to use a .vfproj project file to build the Fortran compiler id source file under the Visual Studio generators.
* | CMakeDetermineCompilerId: Fix Intel Fortran compiler id detectionBrad King2013-10-161-1/+4
| | | | | | | | | | | | | | | | | | The Intel Fortran compiler needs the /fpp option to enable C preprocessing. Without the option the compiler may warn and ignore preprocessor lines instead of failing with an error. Detect the warning and treat it as failure so that we move on to try /fpp and detect the correct id. Without this it works only by luck because Intel is the first compiler id in our detection source file.
* | VS: Fix CMAKE_<LANG>_COMPILER detection with Intel toolset (#14471)Brad King2013-10-161-0/+3
| | | | | | | | | | When the platform toolset is from Intel, look for "icl.exe" instead of "cl.exe".
* | Merge topic 'clang-cl-compiler'Brad King2013-10-081-2/+19
|\ \ | | | | | | | | | | | | | | | | | | 3d8356d Clang: Support Windows variants for GNU and MSVC (#13035, #14458) 51ab85c CMakeDetermineCompilerId: Add notion of "simulated" id/version be10826 CMakeDetermineCompilerId: Fix local var init
| * | CMakeDetermineCompilerId: Add notion of "simulated" id/versionBrad King2013-10-041-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers try to simulate other compilers as a drop-in replacement supporting all the same command-line options and predefined preprocessor macros. In such cases it will be useful to have CMake load the compiler information files for the simulated compiler instead of duplicating the information. Teach CMakeDetermineCompilerId to extract the simulated compiler id and version when the compiler id detection provides it.
| * | CMakeDetermineCompilerId: Fix local var initBrad King2013-10-041-1/+2
| |/ | | | | | | | | Add initialization of the ARCHITECTURE_ID local and fix the initialization of the COMPILER_ID_TWICE local.
* | Merge topic 'vs-compiler-id-tolerate-diagnostics'Brad King2013-10-071-1/+2
|\ \ | |/ |/| | | | | 8c891f8 VS: Tolerate diagnostic output while detecting cl (#14387)
| * VS: Tolerate diagnostic output while detecting cl (#14387)Brad King2013-09-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When the VS IDE build output setting Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project output verbosity is set to "Diagnostic" the build output contains a " (TaskId:###)" suffix on the CMAKE_<lang>_COMPILER= line used to extract the compiler executable location. Strip this suffix before checking that the reported location exists.
* | VS: Use version-specific subsystem for WinCE compiler id (#14440)Patrick Gansterer2013-09-251-1/+5
|/ | | | | | The subsystem must be set to WINDWOSCE for some SDKs to link an executable. Set it to 9 for VS2005 and to 8 for VS2008, since the value differs between the different Visual Studio versions.
* Merge topic 'peheader'Brad King2013-08-061-0/+29
|\ | | | | | | | | bd827f9 WIN: Use COFF file header header for architecture detection (#14083)
| * WIN: Use COFF file header header for architecture detection (#14083)Patrick Gansterer2013-08-051-0/+29
| | | | | | | | | | Read the machine field from the COFF file header to get the exact target architecture for ARM and SHx on the Windows platform.
* | VS: Replace ArchitectureId with PlatformNamePatrick Gansterer2013-08-051-4/+4
| | | | | | | | | | | | | | | | Since we do not need the information about the target architecture we can use the PlatformName only to specify the this information. This also removes setting of the MSVC_*_ARCHITECTURE_ID variable which is not required, because this variable gets set by the compiler detection code in CMAKE_DETERMINE_COMPILER_ID_CHECK().
* | VS: Set CMAKE_VS_PLATFORM_NAME for VS7 and VS71 tooPatrick Gansterer2013-08-051-3/+0
| | | | | | | | | | Move the code which sets CMAKE_VS_PLATFORM_NAME from cmGlobalVisualStudio8Generator to cmGlobalVisualStudio7Generator.
* | VS10: Do not set the TargetMachine when detecting the compilerPatrick Gansterer2013-08-051-8/+1
| | | | | | | | | | | | | | The Microsoft linker is intelligent enough to detect the target machine type depending on the input files. This allows us to get the target architecture from the compiler instead of maintaining the mapping to the platform name.
* | VS6: Hardcode id_machine_6 for compiler detectionPatrick Gansterer2013-08-051-1/+0
|/ | | | | id_machine6 is never set to an other value than x86. So it is safe to remove the replacements with "x86" directly.