summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* VS: Detect MSVC compiler id on ARM toolchainAlexander Mohr2013-05-081-0/+2
| | | | | This enables detection with the VS2012 CTP for windows Blue (8.1). To build native ARM you need to have the WOA SDK (Windows on ARM).
* Xcode: Implement generator toolset selection (#9831, #13802)Brad King2013-02-071-0/+5
| | | | | Implement generator toolset selection (cmake -T) for Xcode > 2.0 by adding the GCC_VERSION build setting to project files.
* VS: Add the entry point when compiling for WindowsCEPatrick Gansterer2012-11-301-1/+1
| | | | | Set the entry point to mainACRTStartup to make sure that main() can be found when linking the application to check the compiler.
* VS: Set the correct SubSystem when determinating the CompilerIdPatrick Gansterer2012-11-301-0/+3
| | | | Some WinCE linker only work when the subsystem is set to WINDOWSCE.
* VS: Make DetermineCompilerId working with WinCE tooPatrick Gansterer2012-11-271-0/+3
| | | | | | Add a dummy mainCRTStartup() function, since the linker searches for it instead of main() and set the CMAKE_SYSTEM_* variables depending on the MSVC_C_ARCHITECTURE_ID and CMAKE_VS_WINCE_VERSION variables.
* VS: Add CMAKE_VS_PLATFORM_NAME definition to cmMakefilePatrick Gansterer2012-11-261-6/+7
| | | | | | When adding more platforms to the Visual Studio generators a simple regular expressing can not handle all cases anymore. This new define holds the name of the Visual Studio target platform.
* VS: Remove TargetMachine for linker when checking compiler idPatrick Gansterer2012-11-201-3/+0
| | | | | | If the TargetMachine isn't defined the linker will choose the correct target depending on the input file. This helps us later with additional compiler platforms for WinCE.
* OS X: Ignore MACOSX_DEPLOYMENT_TARGET during Xcode compiler idBrad King2012-09-241-0/+8
| | | | | Xcode honors this environment variable if the project file does not set it. Hide it from Xcode while building the compiler id project.
* VS11: Add VS 2012 Express support (#13348)Brad King2012-09-181-1/+1
| | | | | | | | | | | Use the registry entries that vsvars32.bat uses to detect the location of MSBuild.exe in the framework directory. Invoke MSBuild with the option /p:VisualStudioVersion=$version so it knows from which VS version to load the system build rules. Teach cmGlobalVisualStudio11Generator to set its ExpressEdition member using the registry.
* Make platform information files specific to the CMake versionBrad King2012-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
* VS: Detect the compiler id and tool locationBrad King2012-08-221-1/+62
| | | | | | | Configure a hand-generated Visual Studio project to build the compiler id source file since we cannot run the compiler command-line tool directly. Add a post-build command to print out the full path to the compiler tool. Parse the full path to the compiler tool from the build output.
* Xcode: Detect the compiler id and tool locationBrad King2012-08-221-1/+35
| | | | | | | | Configure a hand-generated Xcode project to build the compiler id source file since we cannot run the compiler command-line tool directly. Add a post-build shell script phase to print out the compiler toolset build setting. Run xcodebuild to compile the identification binary. Parse the full path to the compiler tool from the xcodebuild output.
* CMakeDetermineCompilerId: Prepare to detect IDE compiler idBrad King2012-08-221-27/+43
| | | | | | | | | | | | | | | Teach CMAKE_DETERMINE_COMPILER_ID to check for variable CMAKE_${lang}_COMPILER_ID_TOOL after CMAKE_DETERMINE_COMPILER_ID_BUILD to use as CMAKE_${lang}_COMPILER since it will not be known until after the IDE runs. In CMAKE_DETERMINE_COMPILER_ID_BUILD prepare a cascading "if" so we can use a generator-specific method to compile the identification source file. Leave "if(0)" as a placeholder for now and put the direct compiler invocation in "else()". After running the compiler to build the compiler identification source we file(GLOB) the list of output files as candidates for extracting the compiler information. An IDE may create directories, so exclude exclude directories from this list.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-36/+36
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-156/+156
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* ASM compiler detection: remove debug output (#13270)Alex Neundorf2012-06-121-6/+0
| | | | | | This must have been left in accidentially. Alex
* Add framework to detect compiler version with its id (#12408)Brad King2011-12-071-2/+16
| | | | | | | | | | | | | | | | | | | | Teach CMakePlatformId.h to construct an "INFO:compiler_version[]" string literal from macros COMPILER_VERSION_(MAJOR|MINOR|PATCH|TWEAK) to be defined in CMake(C|CXX)CompilerId.(c|cpp) for each compiler. Provide conversion macros DEC() and HEX() to decode decimal or hex digits from integer values. Parse the version out of the compiler id binary along with the other INFO values already present. Store the result in variable CMAKE_<LANG>_COMPILER_VERSION in the format "major[.minor[.patch[.tweak]]]". Save the value persistently in CMake(C|CXX)Compiler.cmake in the build tree. Document the variable for internal use since we do not set it everywhere yet. Report the compiler version on the compiler id result line e.g. The C compiler identification is GNU 4.5.2 Report CMAKE_(C|CXX)_COMPILER_(ID|VERSION) in SystemInformation test.
* Add temporary debug output for compiler ID detection for ASMAlex Neundorf2011-03-011-0/+7
| | | | Alex
* Make --strict-mode option, and integrate with cmake-guiBill Hoffman2010-09-011-1/+3
|
* Add timeout to execute_process() in CMAKE_DETERMINE_COMPILER_ID().Alex Neundorf2010-08-171-3/+10
| | | | | | | | | | | In CMAKE_DETERMINE_COMPILER_ID_VENDOR() the compiler is called with various arguments. In some cases, this can make the compiler hang and wait forever for input (e.g. "as -v"). That's why add an timeout so it terminates finally. 10 seconds should be more than enough, this is the time it takes to startup the compiler, which is usually quite fast. Alex
* Detect a COMPILER_ID also for ASM.Alex Neundorf2010-08-151-0/+11
| | | | | | | | | | | | | | | For assembler, the "compiler ID" cannot be detected by "compiling" a source file, since there is not source file all assemblers understand. Instead the function CMAKE_DETERMINE_COMPILER_ID_VENDOR() is used to run the assembler and check its output. For this the CMAKE_DETERMINE_COMPILER_ID_VENDOR() function had to be extended so that it creates the run directory if it doesn't exist yet. In CMakeASMInformation.cmake now also CMAKE_ASM_COMPILER_ID is used (but there are no such files yet, will come with the support for the IAR toolchain). Alex
* Remove trailing spacesAlex Neundorf2010-08-151-2/+2
| | | | Alex
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Support multiple arguments in CC,CXX,FC valuesBrad King2010-03-151-0/+1
| | | | | | | | | Teach compiler identification to support values such as export CC='gcc -g -O2' by separating the arguments on spaces. We already do this for the values of CFLAGS, CXXFLAGS, and FFLAGS.
* Add alternate per-vendor compiler id detectionBrad King2010-02-011-0/+40
| | | | | | | At least one Fortran compiler does not provide a preprocessor symbol to identify itself. Instead we try running unknown compilers with version query flags known for each vendor and look for known output. Future commits will add vendor-specific flags/output table entries.
* Change the way 32/64 bit compiles are detected with MSVC and intel makefile ↵Bill Hoffman2009-11-201-1/+10
| | | | builds. Use the platform ID preprocessor approach.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+13
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* BUG: make compiler id detection (almost) work again with sdcc 2.8.0 RC1,Alexander Neundorf2008-03-091-4/+4
| | | | | | | | | | mail sent to Brad for the remaining issue don't match INFO:compiler[" COMPILER_ID "] which appears in the assembler file generated from the C file by sdcc, but make sure the first character after the [ is no double quote Alex
* ENH: Improvied compiler identification robustnessBrad King2008-02-251-37/+39
| | | | | | | | - Write a single source file into the compiler id directory - This avoid requiring the compiler to behave correctly with respect to include rules and the current working directory - Helps to identify cross-compiling toolchains with unusual default behavior
* ENH: Cleanup chrpath feature by not displaying exe format or placing ↵Brad King2008-01-221-4/+2
| | | | non-advanced options in cache.
* ENH: remove RAISE_SCOPE() again and instead add SET(<var> <value> PARENT_SCOPE)Alexander Neundorf2008-01-181-6/+6
| | | | Alex
* ENH: Add support to CMAKE_DETERMINE_COMPILER_ID macro to try building the id ↵Brad King2008-01-071-91/+158
| | | | source more than once with different extra flags added to the compiler. Use the support to correctly identify the Intel Fortran compiler on windows which does not preprocess by default without special flags.
* ENH: check the magic code of the executable file to determine the executableAlexander Neundorf2008-01-021-0/+32
| | | | | | | | | | file format. Tested for ELF on x86 Linux, COFF and Mach-O prepared but commented out since I don't have such systems available. Please have a look a CMakeDetermineCompilerId.cmake and enable the test for them too. Only add the option for using chrpath if the executable format is ELF Alex
* BUG: Need to strip leading and trailing whitespace off the compiler 'ARG1'. ↵Brad King2007-12-151-2/+5
| | | | This fixes bug#6141.
* BUG: fix compiler id test on cygwinAlexander Neundorf2007-08-101-2/+2
| | | | Alex
* ENH: UNIX, CYGWIN, WIN32, APPLE, QNXNTO and BEOS are not longer set inAlexander Neundorf2007-08-091-2/+2
| | | | | | | | | | | | | | cmMakefile.cxx, but now in the platform files and are now valid for the target platform, not the host platform. New variables CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE and CMAKE_HOST_CYGWIN have been added in cmMakefile.cxx (...and have now to be used in all cmake files which are executed before CMakeSystemSpecificInformation.cmake is loaded). For compatibility the old set is set to the new one in CMakeDetermineSystem.cmake and reset before the system platform files are loaded, so custom language or compiler modules which use these should still work. Alex
* BUG: use ${LANG}_COMPILER_ARG1 also here, otherwise some compilers won't beAlexander Neundorf2007-06-271-2/+2
| | | | | | | able to compile e.g. the C++ source file (e.g. the ADSP compiler needs -c++ for compiling C++ files) Alex
* STYLE: remove out commented codeAlexander Neundorf2007-06-071-3/+1
| | | | Alex