Commit Graph

680 Commits

Author SHA1 Message Date
Ben Boeckel e423f1c05d Windows: Avoid () in environment variable references
Use nested variable evaluation instead.
2014-05-08 13:24:49 -04:00
Brad King 2e095099ec Merge topic 'osx-iframework'
1bed75a5 OS X: Use -iframework for system framework directories
2014-05-07 09:13:37 -04:00
Brad King 3e2e15eead Merge topic 'xcode-sdkroot'
5dfe9b7d Xcode: Find fallback SDK if one matching the OS version doesn't exist.
2014-05-07 09:13:35 -04:00
Mikołaj Siedlarek 1bed75a590 OS X: Use -iframework for system framework directories
Just like -I flag has its -isystem counterpart which marks an include
directory as a system directory and prevents unwanted warnings, on Apple
systems there is -iframework -- a system directory replacement for -F.
Use this flag to implement include_directories(SYSTEM) for frameworks.
2014-05-07 09:04:48 -04:00
Clinton Stimpson 5dfe9b7d5a Xcode: Find fallback SDK if one matching the OS version doesn't exist.
For example if one installs Xcode 4.6 on OS X 10.9, it doesn't contain
a 10.9 SDK, so fallback to the next newest version which, in this case,
happens to be a 10.8 SDK.

This fixes bug #14572.
2014-05-06 09:18:00 -06:00
Brad King bbc358c3fc Merge branch 'master' into osx-init-early
Resolve conflict in Source/cmGlobalGenerator.cxx by integrating
changes from both sides.
2014-04-29 09:36:55 -04:00
Brad King 0200d0a9c4 OS X: Factor a Darwin-Initialize module out of Platform/Darwin
Initialize variables CMAKE_OSX_SYSROOT, CMAKE_OSX_DEPLOYMENT_TARGET, and
CMAKE_OSX_ARCHITECTURES prior to enabling any languages.  This will
allow compiler identification to consider these values.
2014-04-29 09:36:14 -04:00
Brad King ef10fc47ae Merge topic 'implicit-libNN-dirs'
cc57ff5c Drop /lib32 and /lib64 from link directories and RPATH (#14875)
2014-04-17 09:10:53 -04:00
Brad King cc57ff5c49 Drop /lib32 and /lib64 from link directories and RPATH (#14875)
Extend CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES with these paths.  We
already have the equivalents under /usr.  Systems that have these
directories have their dynamic loaders configured already.  Do not allow
them to appear in the RPATH explicitly.
2014-04-16 11:40:48 -04:00
Brad King 028aee1a07 Merge topic 'mingw-archive-no-replace'
39d0ade0 Windows-GNU: Support duplicate object names in large archives (#14874)
2014-04-15 10:22:36 -04:00
Brad King 18aaed77c0 Merge topic 'matches-cleanup'
f21ac16e Replace MATCHES test on numbers with EQUAL test
7eacbaed Replace MATCHES ".+" tests with NOT STREQUAL ""
3a71d34c Use CMAKE_SYSTEM_NAME instead of CMAKE_SYSTEM where sufficient
b0b4b460 Remove .* expressions from beginning and end of MATCHES regexs
5bd48ac5 Replace string(REGEX REPLACE) with string(REPLACE) where possible
2622bc3f Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
2014-04-15 10:22:34 -04:00
Peter Kümmel b735c8cb43 MinGW: link like on Unix and use compile flags when linking 2014-04-15 10:17:06 -04:00
Brad King 39d0ade07e Windows-GNU: Support duplicate object names in large archives (#14874)
Since commit v2.6.0~388 (Added build rule variables
CMAKE_<LANG>_ARCHIVE_..., 2008-01-29) we use separate "ar cr ..." and
"ar r ..." steps to incrementally add a large list of object files to an
archive.  Since the "r" command replaces existing objects of the same
name in an archive, if multiple objects have the same file name and
appear in separate append steps then one overwrites the other.  Instead,
use "ar cq ..." and "ar q ..." to always append to the archive.

We already remove the archive before creating it so this will not cause
objects to be appended to existing archives on incremental rebuilds.
2014-04-14 14:35:19 -04:00
Rolf Eike Beer b0b4b4602f Remove .* expressions from beginning and end of MATCHES regexs
All these expressions work the same:
  "foo"
  ".*foo.*"
  "^.*foo.*$"

This assumes that the "Intel*" expressions were meant to be "Intel.*".
2014-04-14 18:17:11 +02:00
Rolf Eike Beer 5bd48ac534 Replace string(REGEX REPLACE) with string(REPLACE) where possible
The simple replacement is much faster.
2014-04-14 18:17:05 +02:00
Brad King 61ac6d6401 Merge topic 'revert-Android-platform'
4b31f064 Revert "Modules: Add an Andriod platform file"
2014-04-11 09:13:10 -04:00
Stephen Kelly 4b31f0649c Revert "Modules: Add an Andriod platform file"
This reverts commit 77f06b145d.

It may be re-added in the future when the requirements for that
platform are better known and supported by CMake.
2014-04-10 17:34:41 +02:00
Jiri Malak cb9b1e13e4 Watcom: Use single quote for all file/path items in wlink command
Watcom Linker use single quote if necessary for quoting target name,
libraries names and libraries search path.  Object names were already
fixed.
2014-04-08 13:28:54 -04:00
Jiri Malak 1e22b23c81 Watcom: Cleanup Windows-wcl386 configuration
* Remove Watcom linker caseexact options already defined in system
  definition.
* Use win_dll system for SHARED_LIBRARY and SHARED_MODULE.
* Use explicit target definition -bt=.. option for proper initialization
  of compiler Windows environment (predefined macros)
* Reorganize compiler options to global options and configuration
  specific options
* Use option to optimize out stack checking code for release version
2014-04-02 09:14:50 -04:00
Brad King 382c9ee859 Merge topic 'link-line-quoting'
423009c1 Makefile: Generate single-quoted object lists for Watcom
a863a8fe cmLocalUnixMakefileGenerator3: Re-organize ConvertToQuotedOutputPath
2014-04-01 11:06:08 -04:00
Jiri Malak 423009c17f Makefile: Generate single-quoted object lists for Watcom
Drop the CMAKE_NO_QUOTED_OBJECTS internal variable from the Makefile
generators.  The underlying problem is with the Watcom linker, not with
WMake.  The Watcom linker wants object files to be single-quoted.  Add
<LINK-RULE>_USE_WATCOM_QUOTE platform information variables to tell the
generators to use Watcom-style single quotes for object files on link
lines.

On Windows, Watcom uses the GetCommandLine API to get the original
command-line string and do custom parsing that expects single quotes.
On POSIX systems, Watcom approximates the original command line by
joining all argv[] entries separated by a single space.  Therefore we
need to double-quote the single-quoted arguments so that the shell does
not consume them and they are available for the parser to see.
2014-03-27 13:45:29 -04:00
Adrien Destugues 0cc42b871a Haiku: Fix compiler detection when using distcc
Also remove outdated include directories.
2014-03-21 08:19:10 -04:00
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