summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Avoid if() quoted auto-dereference when checking for "MSVC"Fraser Hutchison2014-11-191-2/+2
| | | | | When testing CMAKE_<LANG>_COMPILER_ID values against "MSVC", do not allow the definition of the "MSVC" variable to be expanded.
* Update the Clang pattern to specify compiler options.Stephen Kelly2013-11-251-2/+7
| | | | | | | | | | In Clang 3.4, the preferred (and new) option pattern is --target=. http://thread.gmane.org/gmane.comp.compilers.clang.devel/29975 http://llvm.org/viewvc/llvm-project?view=revision&revision=184408 Clang 3.4 is not yet released, but there is a release candidate, and there is a dashboard test of Clang trunk.
* Allow toolchain files to specify an external toolchain.Stephen Kelly2013-11-191-0/+1
| | | | | | | | | Clang can compile code, but uses the gcc tools for other tasks such as linking. The -gcc-toolchain option can be used for that, but generalize so that other compilers can be treated the same. If such a location is specified, use it as a hint for finding the binutils executables.
* Add compiler target compile options.Stephen Kelly2013-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For clang, this allows passing -target <triple> to the compiler, and for qcc, -V<arch> using toolchain files containing something like set(triple arm-linux-gnueabihf) set(CMAKE_C_COMPILER "/usr/bin/clang") set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") set(CMAKE_CXX_COMPILER_TARGET ${triple}) or set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) Both clang and qcc are inherently cross compiler( driver)s. When cross-compiling with clang, use the CMAKE_${lang}_COMPILER_TARGET as the _CMAKE_TOOLCHAIN_PREFIX to find the appropriate binutils. When cross-compiling with QNX qcc, use the CMAKE_${lang}_COMPILER_TARGET to set the appropriate _CMAKE_TOOLCHAIN_PREFIX.
* Clang: Support Windows variants for GNU and MSVC (#13035, #14458)Brad King2013-10-041-7/+13
| | | | | | | | | | | | | | | | Teach the compiler identification preprocessor tests to report when Clang simulates MSVC, and what version. If not MSVC, assume GNU. Teach compiler information modules Clang-(C|CXX) to recognize when Clang simulates MSVC and skip loading the GNU information. Teach the Windows-MSVC platform information to recognize when it is loaded as the simulated compiler and use that version information instead of the real compiler's (different) version scheme. Add platform modules Windows-Clang-(C|CXX) and support module Windows-Clang to load either Windows-MSVC or Windows-GNU and wrap the corresponding information macros.
* Revert "Add compiler target compile options."Stephen Kelly2013-08-091-1/+0
| | | | This reverts commit 2d9ec1dadfdd10043a98d425abb25d0aef117699.
* Add compiler target compile options.Stephen Kelly2013-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | For clang, this allows passing -target <triple> to the compiler, and for qcc, -V<arch> using toolchain files containing something like set(triple arm-linux-gnueabihf) set(CMAKE_C_COMPILER "/usr/bin/clang") set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") set(CMAKE_CXX_COMPILER_TARGET ${triple}) or set(arch gcc_ntoarmv7le) set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc) set(CMAKE_C_COMPILER_TARGET ${arch}) set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) Both clang and qcc are inherently cross compiler( driver)s.
* Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-021-0/+1
| | | | | | This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang.
* Clang: Add -isystem flag support everywhereBen Boeckel2013-03-281-0/+1
| | | | | | | | In GNU.cmake, -isystem is not used if APPLE is set. However, Clang has pretty much always supported -isystem, so we should always use it. In the future, GNU.cmake should do a version check to see if -isystem is supported.
* Clang: All versions know about -fPIE (#13550)Brad King2012-09-191-0/+1
| | | | | | The GNU compiler information file tests for GNU >= 3.4 because earlier versions do not have the flag. The version number test is not valid for Clang compiler versions, but we know Clang supports the flag.
* Clang: Split Compiler/Clang* modules out from GNU (#13550)Brad King2012-09-191-0/+25
While Clang presents an almost identical interface to GNU there will be some differences. Split the compiler information modules to allow separate rules for Clang. Start by loading the GNU rules but leave a place to add Clang-specific information.