Commit Graph

658 Commits

Author SHA1 Message Date
Brad King d8fb08a391 Merge topic 'watcom-updates'
64c2342a Watcom: Enable 'WMake Makefiles' generator on Linux
5d9aa66c Watcom: Introduce OpenWatcom compiler id and fix compiler version
9292d3b8 Watcom: Detect compiler target architecture and platform
fbc883c9 Watcom: Add one blank line to Makefile for better readability
2014-03-20 09:22:30 -04:00
Stephen Kelly 77f06b145d Modules: Add an Andriod platform file
It is much like Linux but has no SONAME or RPATH.
2014-03-20 09:04:31 -04:00
Jiri Malak 5d9aa66c91 Watcom: Introduce OpenWatcom compiler id and fix compiler version
Distinguish "Open Watcom" from old "Watcom" by introducing a new
"OpenWatcom" compiler id.  The __WATCOMC__ format is "VVRP" for Watcom
and "VVRP + 1100" for Open Watcom.
2014-03-17 15:00:59 -04:00
Brad King 489b1c23b9 Windows: Use response files to specify link libraries for GNU tools
Work around the command-line-length limit by using an @linklibs.rsp
response file to pass the flags for link libraries.  This allows
very long lists of libraries to be used in addition to the existing
support for passing object files via response file.

Suggested-by: Peter Keuschnigg <peter.keuschnigg@pmu.ac.at>
2014-03-05 13:07:41 -05:00
Brad King ae215492cf Merge topic 'watcom-wlib-quoting'
5c5be193 Watcom: Fix static library name quoting for wlib
2014-03-03 10:06:21 -05:00
Jiri Malak 5c5be193cf Watcom: Fix static library name quoting for wlib
Use double-quotes instead of single-quotes around the static library
target name in 'wlib' invocations.
2014-02-28 13:34:59 -05:00
Brad King 00503d387e Watcom: Fix creation of DLLs without any exported symbols
Create each DLL import library by passing "option implib=..." to the
linker for its SHARED library.  This works even when there are no
symbols to be exported.  Leave the option out for MODULE libraries
because we do not need an import library for them.  For executables,
retain the separate invocation of wlib because we want an import
library only when the ENABLE_EXPORTS property is set, and in that
case the project should provide symbols.

Suggested-by: J Decker <d3ck0r@gmail.com>
2014-02-27 16:22:28 -05:00
Brad King fba51b096e MSVC: Add properties to configure compiler PDB files (#14762)
Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files
2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY
properties.  Those properties now exclusively handle linker PDB files.
Since STATIC libraries do not link their compiler PDB file becomes more
important.  Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and
"COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB
file location and pass the value to the MSVC /Fd option.
2014-02-26 09:34:38 -05:00
Brad King a3bac644f1 Merge topic 'isystemForIcpc'
cab5ebd4 Intel compiler: add -isystem flag under Linux
2014-02-17 09:59:43 -05:00
Brad King 3693c63f2e OS X: Split Intel compiler information files
Create platform information modules Platform/Darwin-Intel-(C|CXX).cmake
and helper module Platform/Darwin-Intel.cmake.  Teach existing module
Platform/Darwin-Intel-Fortran.cmake to use the helper too.  Move
information from Platform/Darwin-icc.cmake into these files and drop
information already in Platform/Darwin.cmake to avoid duplication.
2014-02-11 10:04:26 -05:00
Nils Gladitz b7f58511cf Visibility: the Intel compiler does not support -fvisibility on windows 2014-02-07 11:50:08 +01:00
Alex Neundorf cab5ebd497 Intel compiler: add -isystem flag under Linux
This makes the SYSTEM keyword work with the Intel compiler
under Linux. AFAIK this is supported neither under Windows nor OSX.

Alex
2014-02-07 00:23:31 +01:00
Stephen Kelly e00db59d6c QNX: Introduce QCC compiler id for that QNX platform compiler.
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.
2014-01-22 08:47:32 -05:00
Brad King af7489d5a6 Add MirBSD platform support (#14659)
Add a Modules/Platform/MirBSD.cmake module that just includes the
OpenBSD platform module.
2013-12-19 11:08:28 -05:00
Flynn Marquardt 3189ed34b8 OS X: Fix app bundle search path during cross compiling (#14603)
In "Modules/Platform/Darwin.cmake" the variable _apps_paths stays empty
if cross compiling.  Do not de-duplicate an empty list.
2013-12-02 09:32:40 -05:00
Stephen Kelly 7521da2852 Introduce CMAKE_STAGING_PREFIX variable.
This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
2013-11-21 11:48:03 +01:00
Stephen Kelly 76552d595d Add compiler target compile options.
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.
2013-11-19 12:38:53 -05:00
Stephen Kelly fe057ab3cd Allow disabling adding the install prefix to the prefix search path.
In certain scenarios, it is preferable to keep a 'dirty' install prefix
than to clear it, and to expect that content will not be found there.
Add a CMAKE_FIND_NO_INSTALL_PREFIX variable that can be set to disable
searching the install prefix.
2013-10-31 16:40:24 +01:00
Brad King 86a15dbd28 Merge topic 'QNX-ninja-generator'
02cf77f QNX: Don't attempt to create depfiles
2013-10-26 10:29:06 -04:00
Brad King 2e9e28424c Merge topic 'intel-no-i_dynamic'
f61bcbc Intel: Drop deprecated -i_dynamic flag from Fortran (#14507)
2013-10-26 10:28:38 -04:00
Stephen Kelly 02cf77f712 QNX: Don't attempt to create depfiles
The qcc driver can not handle the flags. This makes it possible to use
qcc with the Ninja generator.
2013-10-25 07:00:38 +02:00
Brad King f61bcbce1a Intel: Drop deprecated -i_dynamic flag from Fortran (#14507)
The -i_dynamic flag is deprecated and not even listed in the manual for
Intel Composer XE 2013.

Reported-by: Izaak Beekman <zbeekman@gmail.com>
2013-10-24 09:29:43 -04:00
Brad King 7d47c69365 Drop compatibility with CMake < 2.4
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so.  In the error suggest using a CMake 2.8.x release.

Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4.  They are not supported by CMake >= 3.0.

Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
2013-10-23 08:54:31 -04:00
Brad King 8fa1ceb136 Merge topic 'vs12-parallel-cl-FS'
216afc8 MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)
2013-10-21 09:02:09 -04:00
Brad King 216afc8a81 MSVC: Add /FS flag for cl >= 18 to allow parallel compilation (#14492)
In generators such as Ninja that can run multiple "cl" processes that
refer to the same compiler .pdb file (/Fd) at the same time, MSVC from
Visual Studio 2013 complains:

 fatal error C1041: cannot open program database '.../vc120.pdb';
 if multiple CL.EXE write to the same .PDB file, please use /FS

According to "cl /?":

 /FS force to use MSPDBSRV.EXE

Add the flag to compilation lines for this compiler version just after the
/Fd option.
2013-10-18 10:28:28 -04:00
Brad King a85e17e660 Intel: When simulating MSVC, re-use Windows-MSVC (#14476)
Teach CMake(C|CXX|Fortran)CompilerId* to report the MSVC version
simulated by the Intel compiler, if any.  Refactor the Windows-Intel
platform information helper module to load Windows-MSVC instead of
duplicating the information.  Teach Windows-MSVC to understand when
it is loaded as the simulated Fortran compiler (its preprocessor is
simulated).
2013-10-18 09:55:59 -04:00
Brad King 2e13c36211 OS X: Encode -F framework search flag in per-language platform variable
Compilers for languages other than C and C++ on OS X may not understand
the -F framework search flag.  Create a new platform information
variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it
for C and CXX lanugages in the Platform/Darwin module.

Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2013-10-10 08:33:25 -04:00
Brad King e81b6742f7 Merge topic 'haiku-updates'
54ef2be Haiku: Include files cleanup in cmCTest
38d5555 Haiku: Remove outdated preprocessor checks
1dc61f8 Haiku: Remove use of B_COMMON_DIRECTORY
7ebc1cb Haiku: Several fixes to platform module
2013-10-09 10:23:04 -04:00
Brad King 12a7e2b10c Merge topic 'apple-clang-id'
1763c31 Set policy CMP0025 to NEW while building CMake itself
aa53ee5 Add policy CMP0025 for Apple Clang compiler id compatibility
ab65862 Clang: Add separate "AppleClang" compiler id
2013-10-09 10:21:28 -04:00
Adrien Destugues 7ebc1cb2ff Haiku: Several fixes to platform module
* Do not define BEOS anymore (this includes workarounds which we don't
  need most of the time in Haiku, so we prefer opt-in IF(HAIKU) in the
  cmake files instead).
* On the other hand, do define UNIX (we are trying to be compliant) and
  HAIKU (there is still a number of things we don't do like the
  average UNIX clone)
* Do not use UnixPaths, as our filesystem hierarchy isn't anything like
  what it expects.
* Do not use -nostart, which the compiler doesn't know about anymore.
  This used to be an Haiku extension to gcc, and is equivalent to
  -shared which is the default gcc option.
* While "dl" functions are provided in libroot, this is always
  implicitly linked so there is no need to tell cmake about it.
* Forcing position-independent code is not needed, so remove it.
* On the other hand, include appropriate linker options for executables
  and shared libraries.
* Support for the two available compilers in Haiku (gcc2 and gcc4) and
  pick the right headers and libraries according to the currently
  selected one.
* With the adoption of the package manager, the directory layout was
  changed. Tell cmake where to look for header files and libraries.
* As we don't define BEOS anymore, enable the workaround we still need
  for HAIKU as well. This is the lack of a libm (it is part of the
  implicitly linked in libroot)

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
2013-10-08 09:54:46 -04:00
Brad King ab65862417 Clang: Add separate "AppleClang" compiler id
Apple distributes their own Clang build with their own version numbers
that differ from upstream Clang.  Use the __apple_build_version__ symbol
to identify the Apple Clang compiler and report the Apple Build Version
as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION.  Add
Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules
that simply include the upstream equivalents.

Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own
source and tests to account for AppleClang.
2013-10-07 20:12:46 -04:00
Brad King 3d8356d486 Clang: Support Windows variants for GNU and MSVC (#13035, #14458)
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.
2013-10-04 13:39:22 -04:00
Brad King 1fce189e53 OS X: Search system SDKs for frameworks
In Modules/Platform/Darwin.cmake set CMAKE_SYSTEM_FRAMEWORK_PATH to
include framework directories from inside the system SDK corresponding
to CMAKE_OSX_SYSROOT.

Suggested-by: Sean McBride <sean@rogue-research.com>
2013-09-27 10:18:46 -04:00
Patrick Gansterer 0b15ffc73b MSVC: Fix WinCE arch family preprocessor symbol (#14436)
In commit bd827f98 (Use COFF file header header for architecture
detection, 2013-08-05) the MSVC_<lang>_ARCHITECTURE_ID value computed by
CMakeDetermineCompilerId.cmake changed for WinCE architectures to be the
exact architecture read from the PE header.  Fix platform preprocessor
definitions in Modules/Platform/Windows-MSVC.cmake to correspond to the
architecture family (ARM or SHx) instead of the specific architecture.
2013-09-25 05:20:22 +02:00
Patrick Gansterer e63cf5f099 MSVC: Fix version test for linking corelibc on Windows CE (#14420)
In commit 8fcf0ab0 (Add support for new Windows CE compiler, 2013-08-04)
we made corelibc conditional on the MSVC version, but the version value
was incorrect.  Update it to use corelibc for VS 2008 and below.
2013-09-23 17:11:47 -04:00
Brad King 3cd753dfff MSVC: Drop /link from executable link lines with Ninja
In commit fb9f73de (MSVC: Invoke 'link' directly for executables,
2013-04-08) we forgot to remove the /link option handling added by
commit e31df039 (Ninja: move <OBJECTS> in front of the first linker
option, 2012-09-27) to the Platform/Windows-MSVC module.  Drop it now.
2013-09-11 14:34:33 -04:00
Brad King 335a1278eb OS X: Do not default to non-existent deployment target SDK
Since commit 95f78e08 (OS X: Search for SDK based on deployment target,
2013-08-02) we select the default OS X SDK path to match the deployment
target.  Fix this behavior in the case that the matching SDK does not
exist and fall back to the SDK for the current host OS X version.
2013-08-14 19:16:42 -04:00
Stephen Kelly b33c9844fa Revert "Add compiler target compile options."
This reverts commit 2d9ec1dadf.
2013-08-09 14:28:43 +02:00
Brad King 4408382f19 Merge topic 'wince800'
0416a0e VS11: Add support for Windows CE SDKs
8fcf0ab Add support for new Windows CE compiler
2013-08-08 13:55:07 -04:00
Patrick Gansterer 8fcf0ab020 Add support for new Windows CE compiler
The new compiler versions do not need corelibc.lib as a default
link library and a architecture detection workaround.
2013-08-07 08:26:26 -04:00
Brad King fc657ef4d3 Merge topic 'osx-no-command-line-tools'
03ab170 OS X: Enable command-line build without tools in PATH
2013-08-07 08:21:24 -04:00
Brad King 03ab170fe0 OS X: Enable command-line build without tools in PATH
Teach modules CMakeDetermineCompiler and CMakeUnixFindMake to ask Xcode
where to find the compiler or make tools, using 'xcrun --find', if none
is found in the PATH.  Teach module Platform/Darwin to add the path to
the SDK to CMAKE_SYSTEM_PREFIX_PATH so that find_* command look there.
Also add the SDK /usr/include directory to the implicit include list in
CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to suppress explicit -I
options for it.
2013-08-06 09:00:18 -04:00
Patrick Gansterer bd827f98ef WIN: Use COFF file header header for architecture detection (#14083)
Read the machine field from the COFF file header to get the exact
target architecture for ARM and SHx on the Windows platform.
2013-08-05 20:04:44 +02:00
Brad King 95f78e08fe OS X: Search for SDK based on deployment target (#14324)
When available, use CMAKE_OSX_DEPLOYMENT_TARGET instead of the host OS X
version to select the default SDK.  This makes sense because one should
use the SDK matching the deployment target.

Suggested-by: John Ralls <jralls@ceridwen.us>
2013-08-02 14:05:00 -04:00
Graham Markall 1af8c8ddae OS X: Add Fortran library version flags (#14249)
The linker flags for setting the compatibility and current versions of
libraries on Darwin are set for the supported Fortran compilers.

Set CMAKE_Fortran_CREATE_SHARED_LIBRARY for the NAG Fortran compiler to
have no space after <SONAME_FLAG> so the NAG compiler can parse the
argument correctly.
2013-07-16 09:27:50 -04:00
Brad King 2cc9f1fd5c OS X: Add copyright notices to Darwin-*-Fortran.cmake 2013-07-16 09:25:06 -04:00
Brad King 4e5cb398ae Merge branch 'master' into vs12-generator
Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping
the side from 'master'.
2013-06-28 18:29:54 -04:00
Brad King 77ac9b8b9c VS12: Add Visual Studio 12 generator (#14251)
Copy cmGlobalVisualStudio11Generator to cmGlobalVisualStudio12Generator
and update version numbers accordingly.  Add the VS12 enumeration value.
Add module CMakeVS12FindMake to find MSBuild.  Look for MSBuild in its
now-dedicated Windows Registry entry.  Teach the platform module
Windows-MSVC to set MSVC12 and document the variable.  Teach module
InstallRequiredSystemLibraries to look for the VS 12 runtime libraries.

Teach tests CheckCompilerRelatedVariables, Preprocess, VSExternalInclude,
and RunCMake.GeneratorToolset to treat VS 12 as they do VS 10 and 11.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2013-06-28 18:13:14 -04:00
Brad King 0c9cc9a077 Embarcadero: Use response files only for includes, objects, and libs
Leave other flags directly in the Makefile command lines and outside
any special inline response file syntax.  Otherwise Borland does
not support flags with quotes in response files.
2013-06-27 12:57:31 -04:00
Stephen Kelly 2d9ec1dadf Add compiler target compile options.
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.
2013-06-11 14:41:16 +02:00