summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineASMCompiler.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'vs-nasm'Brad King2017-02-101-0/+8
|\ | | | | | | | | 5ba2c9e5 VS: Add support for ASM_NASM language
| * VS: Add support for ASM_NASM languageEvgeny Fimochkin2017-02-071-0/+8
| | | | | | | | Fixes: #16469
* | CMakeDetermineCompilerId: check with and without user-specified flagsMichael Maltese2017-02-061-2/+2
|/ | | | | | | | | | | Clang may raise an error when passed a `-march=` option that doesn't correspond to the current target triple. CMake cannot pass the target triple when determining the compiler id because it doesn't know how yet, but it does pass along user-specified flags. This breaks when those user-specified flags include `-march=`. Fix this use case by also trying to find the compiler id without the user-specified flags. Fixes: #16587
* CMakeDetermineASMCompiler: arg-split ASM* env var like CCMichał Górny2016-12-021-1/+7
| | | | | | | Split the arguments off of the `ASM${ASM_DIALECT}` environment variable as is done for `CC` and other compiler variables. This fixes using CMake when `ASM*` is used to pass additional target flags, e.g. when one uses `ASM=${CC}`.
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add support for the ARM Compiler (arm.com)Joakim Andersson2015-11-021-0/+4
| | | | | | | | Create an `ARMCC` compiler id corresponding to compilers identified and versioned by the `__ARMCC_VERSION` predefined macro. See documentation for the compilers at http://infocenter.arm.com/help/topic/com.arm.doc.set.swdev/index.html
* Replace MATCHES ".+" tests with NOT STREQUAL ""Rolf Eike Beer2014-04-141-1/+1
|
* CMakeDetermine*Compiler: Factor out search for compiler in PATHBrad King2014-03-101-16/+1
| | | | | Factor out a _cmake_find_compiler_path helper macro to avoid duplication of the search for a full path to the compiler.
* CMakeDetermine*Compiler: Fix typo 'lile' => 'like'Stephen Kelly2014-01-221-1/+1
|
* Drop use of configure_file IMMEDIATE optionDaniele E. Domenichelli2013-11-131-1/+1
| | | | | | 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.
* CMakeDetermine*Compiler: Remove temporary cache entryBrad King2013-10-241-1/+1
| | | | | | | | When the user or toolchain file sets CMAKE_<LANG>_COMPILER to a name without a path we use find_program with CMAKE_<LANG>_COMPILER_WITH_PATH to search for the tool. Remove the temporary cache entry afterward to avoid exposing it to projects. It is not set by other logic paths so no one should be using it.
* Merge topic 'FixAsmSupport'Brad King2013-06-141-2/+2
|\ | | | | | | | | bc460ea asm support: adapt to changes in CMakeDetectCompiler in 2.8.10
| * asm support: adapt to changes in CMakeDetectCompiler in 2.8.10Alex Neundorf2013-06-141-2/+2
| | | | | | | | | | | | | | | | This fixes #14210. In 2.8.10 CMakeDetermineCompiler.cmake was modified (or added), and now the _INIT variable must not be set to a list anymore, before it worked. Alex
* | Add regexps for the IAR toolchain to the vendor list.Alex Neundorf2013-04-151-0/+4
|/ | | | | | | | | The IAR compilers produce object files where the plain strings at least sometimes can't be found, see: http://www.cmake.org/Bug/view.php?id=10176#c19598 Alex
* rename TI_DSP toolchain to TI, since it works also for the ARM compilerAlex Neundorf2013-03-141-3/+3
| | | | | | Additionally, look for a special ar and strip Alex
* Make platform information files specific to the CMake versionBrad King2012-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-16/+16
| | | | | | | | | | | | | | | | | 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-96/+96
| | | | | | | | | | | | | | | | | 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
* Prefer generic system compilers by default for C, C++, and FortranBrad King2012-08-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach CMake to prefer the system default compiler automatically when no compiler is specified. By default use "cc" for C, "CC" for C++, and "f95" for Fortran. Load a new Platform/<os>-<lang>.cmake module to allow each platform to specify for each language its system compiler name(s) and/or exclude certain names. Create Platform/(CYGWIN|Darwin|Linux|Windows)-CXX.cmake modules to specify "c++" as the system C++ compiler name for these platforms. On systems that use case-insensitive filesystems exclude C++ compiler names that are distinguished from C compiler names only by case. This will change the default compiler selection for existing build scripts that do not specify a compiler when run on machines with separate system and GNU compilers both installed in the PATH. We do not make this change in default behavior lightly. However: (1) If a given build really needs specific compilers one should specify them explicitly e.g. by setting CC, CXX, and FC in the environment. (2) The motivating case is to prefer the system Clang on newer OS X systems over the older GNU compilers typically also installed. On such systems the names "cc" and "c++" link to Clang. This is the first platform known to CMake on which "c++" is not a GNU compiler. The old behavior selected "gcc" for C and "c++" C++ and therefore chooses GNU for C and Clang for C++ by default. The new behavior selects GNU or Clang consistently for both languages on older or newer OS X systems, respectively. (3) Other than the motivating OS X case the conditions under which the behavior changes do not tend to exist in default OS installations. They typically occur only on non-GNU systems with manually-installed GNU compilers. (4) The consequences of the new behavior are not dire. At worst the project fails to compile with the system compiler when it previously worked with the non-system GNU compiler. Such failure is easy to work around (see #1). In short this change creates a more sensible default behavior everywhere and fixes poor default behavior on a widely-used platform at the cost of a modest change in behavior in less-common conditions.
* Factor common code out of CMakeDetermine(ASM|C|CXX|Fortran)CompilerBrad King2012-08-021-24/+11
| | | | | | | | | | | | | | | | | The compiler candidate list selection and search code for C, C++, ASM, and Fortran languages was duplicated across four modules. To look for compilers adjacent to already-enabled languages the C and CXX modules each used _CMAKE_USER_(C|CXX)_COMPILER_PATH and the ASM module used _CMAKE_TOOLCHAIN_LOCATION. Since commit 4debb7ac (Bias Fortran compiler search with C/C++ compilers, 2009-09-09) CMake prefers Fortran compilers matching the vendor and directory of an enabled C or C++ compiler. Factor out the common functionality among the four languages into a new CMakeDetermineCompiler module. Generalize the Fortran implementation so that all languages may each use the vendor and directory of the other languages that have already been enabled. For now do not list any vendor-specific names for C, C++, or ASM so that only the directory preference is used for these languages (existing behavior).
* fix #12465: detect the masm compiler ID ("MSVC")Alex Neundorf2011-10-061-0/+4
| | | | Alex
* Add more regex for gcc, always print the ASM compiler IDAlex Neundorf2011-03-011-7/+8
| | | | | | Now gcc is also recognized via "Free Software Foundation" Alex
* It's ELSEIF(), not ELSIF()Alex Neundorf2011-03-011-1/+1
| | | | Alex
* Fix bad comparison in the detect assembler-codeAlex Neundorf2011-03-011-4/+4
| | | | | | (there was a if("${CMAKE_C_COMPILER}") instead of if(CMAKE_C_COMPILER) ) Alex
* Add support for ASm for the HP compiler.Alex Neundorf2011-02-231-0/+4
| | | | Alex
* Add suport for ASM for the IBM XL compilerAlex Neundorf2011-02-231-0/+4
| | | | Alex
* Add support for ASM for the SunPro compilerAlex Neundorf2011-02-231-0/+4
| | | | Alex
* Add ASM support for the Intel compilerAlex Neundorf2011-02-231-0/+4
| | | | Alex
* Rework the way assembler is handled, use the C/CXX compiler by defaultAlex Neundorf2011-01-301-7/+50
| | | | | | | | | | | | | | | This commit changes the way how the assembler support works in cmake. The language "ASM" now always uses the C/Cxx compiler instead of the assembler directly. This fixes #8392, assembler files are not preprocessed. If one wants to use the assembler directly, the specific assembler "dialect" has to be enabled. I.e. to get as/gas, you have to use now ASM-ATT, the same way for ASM_MASM and ASM_NASM. Implemented this now for gcc. SunStudio, IBM, HP and Intel still todo. Alex
* Fix parsing of compiler name with a version numberAlex Neundorf2011-01-261-3/+4
| | | | | | | This fixes #11679, the toolchain prefix was not correctly detected for arm-eabi-gcc-4.5.2 Alex
* Recognize the Texas Instruments DSP compiler (#11645)Wojciech Migda2010-12-281-0/+3
| | | | | | | | | | | | The TI DSP compiler predefines "__TI_COMPILER_VERSION__". Use this to identify the C and C++ compilers. For assembler language the C compiler executable is used: $ cl6x -h TMS320C6x C/C++ Compiler v6.1.11 Tools Copyright (c) 1996-2009 Texas Instruments Incorporated Use this command-line option and output to recognize the assembler.
* Include CMakeDetermineCompilerId in CMakeDetermineASMCompiler.cmake (#11467)Alex Neundorf2010-11-171-0/+1
| | | | | | | | | CMakeDetermineASMCompiler.cmake relied on that somebody else (usually during enabling C or CXX) already included that file, and broke if that was not the case. Thanks to Louis for the patch Alex
* Detect a COMPILER_ID also for ASM.Alex Neundorf2010-08-151-0/+19
| | | | | | | | | | | | | | | 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-5/+5
| | | | Alex
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+14
| | | | | | | 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.
* Correct comments and use ASM${ASM_DIALECT} env. var instead of ASM env. var ↵Alexander Neundorf2009-09-261-5/+5
| | | | | | to initialize the the assembler to use. Alex
* ENH: add support for the MS masm and masm64 assemblers, works with nmake,Alexander Neundorf2008-11-051-1/+1
| | | | | | not (yet) with the Visual Studio generators Alex
* BUG: make the toolchain-prefix recognition work with prefixes which containAlexander Neundorf2008-05-151-7/+10
| | | | | | | dots (as in arm-unknown-nto-qnx6.3.0-gcc.exe), NAME_WE returns only up to the 6, instead of everything in front of the .exe Alex
* BUG: fix handling of assembler executable (with path) #6858Alexander Neundorf2008-04-211-3/+2
| | | | Alex
* ENH: initial support for assembler in cmake, needs testing by our usersAlexander Neundorf2007-06-281-0/+78
Alex