Commit Graph

781 Commits

Author SHA1 Message Date
Brad King 09da79b40f Merge topic 'fix-CMP0065-NEW-AIX-HP'
f254276f AIX,HP-UX: Fix RPATH handling when CMP0065 is set to NEW
2015-12-14 09:59:58 -05:00
Marc Chevrier f254276fc1 AIX,HP-UX: Fix RPATH handling when CMP0065 is set to NEW
The CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS setting has always been meant
for flags needed to export symbols from executables for use by shared
library plugins.  Since commit v3.4.0-rc1~58^2~1 (CMP0065: Restrict the
use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS, 2015-08-24) this is made
explicit by using the flags only for executables with ENABLE_EXPORTS,
guarded by CMP0065 for compatibility.

On some platforms we were accidentally using this setting to pass other
flags to the linker:

* AIX: -bnoipath, -brtl
* HP-UX: +s, +nodefaultrpath

These flags are incorrectly dropped when CMP0065 is set to NEW.  Fix
this by moving the flags to more appropriate places for linking
executables.
2015-12-11 09:21:47 -05:00
Brad King ad1be6ee76 Merge topic 'detect-cray-wrappers'
a7ef0225 Cray: Refactor the Cray platform files to use compiler wrapper checks
0763a836 Cray: Add macro tests to detect the Cray compiler wrappers
5eaac0c9 Compiler: Add infrastructure for detecting compiler wrappers
2015-12-09 08:36:53 -05:00
Chuck Atkins a7ef02253b Cray: Refactor the Cray platform files to use compiler wrapper checks
This is an extensive refactoring of the Cray compiler wrapper usage.
Using the new compiler wrapper checks, the CrayPrgEnv info files have
been moved from Platform/ to Compiler/.  The adjusted naming convention
allows the compiler-wrapper information files to be loaded for both the
CrayLinuxEnvironment platform when cross-compiling and the Linux
platform if building natively on the Cray compute nodes.  It also
creates a separation of common arguments for compiler id and language
information used to perform the appropriate introspection of implicit
arguments and libraries used by the compiler wrappers based on the
loaded module environment.
2015-12-09 08:35:19 -05:00
James Johnston ddbda72288 Embarcadero: Fix bug where duplicate Ninja job pools would be created.
If the platform file was included multiple times, it was possible that
duplicate Ninja job pools would be created.
2015-12-03 19:10:19 +00:00
Brad King e45e503f14 Merge topic 'add-cray-linux-platform'
743fcf1e Cray: Fix static / dynamic detection logic and parse more driver flags
2015-11-19 09:10:29 -05:00
Chuck Atkins 743fcf1e89 Cray: Fix static / dynamic detection logic and parse more driver flags 2015-11-18 13:36:00 -05:00
April Chin 6772913fff SunOS: Remove obsolete Studio compiler library directories
Our CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES setting is no longer needed
because CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES is now populated with the
actual implicit link directories for the current toolchain.  The old
values we hard-coded in CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES are not
relevant to modern toolchains, so simply drop them.

Co-Author: Shawn Walker-Salas <shawn.walker@oracle.com>
2015-11-16 10:41:10 -05:00
Chuck Atkins c54a621b55 Cray: New platform file for Cray Linux Environment and PrgEnv 2015-11-14 11:34:32 -05:00
Brad King 123de1914c Ninja: Refactor selection of 'deps = ' value for MS-compatible toolchains
Set variables in the platform information modules to tell the Ninja
generator what deps type to use instead of hard-coding conditions in the
generator itself.
2015-10-20 14:14:20 -04:00
Gregor Jasny 24aafbde11 Xcode: Adjust deployment target SDK version to host version
If the automatically selected SDK is newer than the host OS version
and no deployment version has been set then adjust the deployment
version to the host OS version. Otherwise the user won't be able to
launch the executables on the build host.

This is for example a problem on a MacOSX 10.10 host with Xcode 7
which only provides a MacOSX10.11 SDK.
2015-10-12 15:31:10 -04:00
Gilles Khouzam 8c426183d1 MSVC: Add system libs for WindowsStore on VS 2015
Use WindowsApp.lib for a Universal Application Platform project.
2015-10-02 16:41:41 -04:00
Brad King e134e53b47 Add support for *.manifest source files with MSVC tools
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.

Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
2015-09-17 10:21:32 -04:00
Brad King da00be6359 MSVC: Rewrite manifest file handling with Makefile and Ninja
Add a helper class private to "cmcmd.cxx" to contain the implementation.
Update the link logic to use the intermediate files directory for each
target to hold manifest and resource files before embedding into the
binary.  Preserve the old behavior of placing the .manifest file next
to the binary when not linking incrementally even though it will be
embedded.
2015-09-17 10:21:32 -04:00
Brad King 1e2f5dc922 Merge topic 'ar-option-order'
08659ff4 Re-order 'ar' options 'cq' => 'qc'
2015-09-10 11:29:46 -04:00
Brad King 08659ff4cb Re-order 'ar' options 'cq' => 'qc'
The documetnation of binutils:

  https://sourceware.org/binutils/docs/binutils/ar-cmdline.html

suggests to use the parameters "q" and "c" in this order ("q" is
operation, and "c" is the modifier).

Suggested-by: Дилян Палаузов <dilyan.palauzov@aegee.org>
2015-09-09 11:08:20 -04:00
Geoff Viola 63591b94ab GHS: Find latest 'int' directory 2015-09-09 10:12:35 -04:00
Gregor Jasny 67f60958b6 Darwin: Add support for tbd library stub files
Starting with Xcode 7 the OSX and iOS SDKs contain only stub
files for dynamic system libraries. These stub files contain
some meta data and a list of exported sysbols in plain text.

They are handled by the toolchain like regular dylibs.
2015-08-24 22:29:33 +02:00
Brad King f9865743ed Merge topic 'hp-ux-itanium-shared-libs'
625225bb HP-UX: Do not use ".sl" extension for shared libs on Itanium
2015-08-21 09:28:55 -04:00
Brad King 625225bbe6 HP-UX: Do not use ".sl" extension for shared libs on Itanium
Instead use the standard ".so" extension.

Suggested-by: Gerhard Grimm <gerhard.grimm@detec.com>
2015-08-18 10:55:16 -04:00
Kars de Jong 462fbd1eca Add support for ARTOS platform using GNU C with ac compiler driver
Add platform and compiler descriptions for ARTOS RTOS (locamation.com).

Signed-off-by: Kars de Jong <kars.dejong@locamation.nl>
2015-08-17 10:32:50 -04:00
Chuck Atkins dc64d8250b HP-UX: Fix linker search type flags for C shared libs on HP-UX
Since commit v2.8.7~31^2 (HP: Drive shared library linking with compiler
front end, 2011-12-12) the C compiler is used to link shared libraries
instead of calling the linker directly, so linker options need to be
wrapped as -Wl,-foo instead of -foo.
2015-08-12 09:36:57 -04:00
Brad King 60fe4b540b SunOS: Drop special case for linking C++ shared libraries with gcc (#15673)
Since commit v2.4.0~4325 (...use gcc -shared, even for C++ libraries,
2003-03-13) we use the C compiler "gcc" to link C++ shared libraries
compiled with "g++".  At the time "g++" did not know how to link shared
libraries correctly.  This has long since been fixed so simply drop the
special case.
2015-07-30 13:59:29 -04:00
Brad King afed519337 Merge topic 'osx-iframework'
e68f0cb3 OS X: Use -iframework with AppleClang only on version >= 4.2
2015-07-23 08:47:23 -04:00
Brad King e68f0cb3d4 OS X: Use -iframework with AppleClang only on version >= 4.2
Since commit v3.1.0-rc1~564^2 (OS X: Use -iframework for system
framework directories, 2014-05-05) we test the version of Clang to see
if it supports -iframework.  Fix the version test used for AppleClang
since it uses a different version scheme than upstream Clang.
2015-07-22 09:04:04 -04:00
Stanimir Kabaivanov 606b29d427 Add EUROS RTOS platform description file
Add a basic platform module for EUROS RTOS (euros-embedded.com).

Co-Author: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
2015-07-14 14:33:20 -04:00
Brad King c736de7b28 Factor an <INCLUDES> placeholder out of <FLAGS> in rule variables
Teach the Makefile and Ninja generators to substitute for an <INCLUDES>
placeholder instead of putting -I in <FLAGS>.  Update our values for

  CMAKE_<LANG>_COMPILE_OBJECT,
  CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and
  CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE

to place <INCLUDES> just before <FLAGS>.
2015-07-13 10:49:46 -04:00
Brad King 6f94b03c97 Place <DEFINES> before <FLAGS> consistently across compilers
Update our values for

  CMAKE_<LANG>_COMPILE_OBJECT,
  CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and
  CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE

to place <DEFINES> before <FLAGS> consistently across supported
compilers.  We already do this for most compilers, so update the rest
for consistency.
2015-07-13 10:49:46 -04:00
Brad King ad91d0edd5 Merge topic 'auto_export_dll_symbols'
8f86407c Windows: Optionally generate DLL module definition files automatically
069aa93b bindexplib: Add support for "/bigobj" format objects
61bbbdcf bindexplib: Fix treatment of some symbols
de70c922 bindexplib: Teach DumpFile to return errors
8ea69dfe bindexplib: Build source as part of CMakeLib
2963cb2a bindexplib: Wrap long lines
4ff09893 bindexplib: Drop code that CMake does not need
7de8276c bindexplib: Add copyright/license notice block
65086ad7 bindexplib: Import original implementation from CERN
2015-07-08 09:19:07 -04:00
Bill Hoffman 8f86407cfd Windows: Optionally generate DLL module definition files automatically
Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically
generate a module definition file from MS-compatible .obj files and give
it to the linker in order to export all symbols from the .dll part of a
SHARED library.
2015-07-06 11:11:02 -04:00
Brad King 806609c702 VS: Add /machine: flag to Librarian tool (#11240)
If a Windows resource (.rc) source file is included in a STATIC library,
the VS "link" tool will process the compiled ".res" file and needs to know
the target architecture.  Without it, we may get a LNK4068 warning and
possibly a LNK1112 error.  Add /machine: to the default static library
flags to give the link tool the information it needs.
2015-06-26 10:07:08 -04:00
Brad King a53f1af79f Merge topic 'ConcurrentFortran-compiler-id'
54676a0e Help: Add notes for topic 'ConcurrentFortran-compiler-id'
7cd539b1 Add support for Concurrent Fortran 77 Compiler
0d204c1c CMakeDetermineCompilerId: Try matching compiler output to detect id
5f0dad75 CMakeDetermineCompilerId: Refactor id build/check loop logic
c65a060e CMakeDetermineCompilerId: Optionally try some flags before no flags
2015-06-19 08:51:43 -04:00
James Johnston 078b60f05c Embarcadero: Run at most one linker invocation at a time (#15620)
At least some versions (e.g. C++ Builder 5) of the bcc32 linker are known to
write temporary files with a constant name to the current directory (e.g.
"turboc.$ln").  (This can be verified by using Process Monitor to watch the
file writes that bcc32 / ilink32 / implib make).  This causes problems with
some generators that keep a constant current directory and run concurrent
linkers.

For example, the Ninja generator, by default, always has the current directory
set to the top of the build tree - resulting in conflicts between the linkers
that are simultaneously trying to write to "turboc.$ln".  Symptoms include
direct errors regarding the "turboc.$ln" file, or later build steps failing due
to corrupted output from previous links that happened to link "successfully."

This is not a problem for the Borland Makefiles generator which does not
run jobs in parallel.  For the Ninja generator, work around this problem
by using a link job pool of size 1.
2015-06-18 16:29:43 -04:00
Brad King 7cd539b163 Add support for Concurrent Fortran 77 Compiler
The Concurrent Fortran compiler (ccur.com) is available on Linux and can
be used much like the GNU Fortran compiler.  Currently it has no
preprocessor symbols to identify it so we need to detect it by matching
compiler output.

Suggested-by: Anthony Ette <Anthony.R.Ette@controlsdata.com>
2015-06-18 11:36:12 -04:00
Brad King f43defaec4 GNU: Drop -rdynamic flag from Fortran
The GNU Fortran compiler does not document support for this flag as the
GNU C and C++ compilers do.
2015-06-16 13:58:41 -04:00
Brad King f5dbf00da6 Windows-GNU: Restore find_library treatment of '.dll' as linkable (#15409)
Revert commit v3.3.0-rc1~435^2 (Windows-GNU: Do not tell find_library to
treat '.dll' as linkable, 2015-02-18).  MinGW tools support linking to
'.dll' files directly and many non-CMake build systems still do not
provide a separate '.dll.a' file.
2015-06-08 10:16:18 -04:00
Brad King bd2ef44b55 Intel: Disable Fortran optimizations for Debug config on Windows (#15583)
The "/Od" flag is used for C and C++ languages in this configuration so
we should use it for Fortran too.

Suggested-by: Oleg V. Zhylin <ovz@yahoo.com>
2015-05-26 10:25:31 -04:00
Brad King cf8ce7a39e RC: Do not override MinGW Makefiles generator preference
Update logic added in commit 957c2aac (RC: Simplify selection of
resource compiler based on C/C++ toolchain, 2015-05-07) to avoid
overriding CMAKE_GENERATOR_RC.  The MinGW and MSYS Makefiles
generators use it to select a windres next to the compiler even
if it is not in the PATH.
2015-05-11 09:00:25 -04:00
Brad King 957c2aac7f RC: Simplify selection of resource compiler based on C/C++ toolchain
Revert the refactoring by commit v2.8.11~105^2~1 (Ninja: use MinGW
generator code in EnableLanguage, 2013-03-09) and move the MinGW-
specific logic back to the "MinGW Makefiles" generator.  Instead teach
the platform information modules for GNU and MSVC on Windows to set the
preferred RC compiler just before enabling the RC language.  This way
we choose the RC compiler based on the C/C++ toolchain that is actually
enabled.
2015-05-07 11:43:02 -04:00
Brad King f47342701c HP-UX: Add GNU compiler information for ASM language
Suggested-by: Gerhard Grimm <gerhard.grimm@detec.com>
2015-05-04 11:06:16 -04:00
Geoff Viola 48004d9dbe Add a 'Green Hills MULTI' generator on Windows
Green Hills MULTI is an IDE for embedded real-time systems.  The IDE's
product page can be found here:

 http://www.ghs.com/products/MULTI_IDE.html

It supports cross compiling on ARM, Intel x86, and other architectures
with various operating systems.  The IDE exists on Linux and Windows
host systems, but CMake will currently only generate the project files
on Windows host systems.
2015-04-20 13:55:40 -04:00
Brad King 81db6506a9 Merge topic 'blugeneq-platform-files'
13807bcb BlueGene/Q Platform files
2015-03-24 11:26:24 -04:00
Gregor Jasny 52642b466e OS X: Look for Xcode 5 platform-specific Frameworks
The Xcode 5 platform specific framework locations differ from the Xcode
6 ones.  Look first for the Xcode 6 ones, then for iOS Xcode 5 ones and
last for the Xcode 5 OS X ones.

For reference, the XCTest.framework is located as follows:

 Xcode511.app/Contents/Developer/Library/Frameworks/XCTest.framework
 Xcode511.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/Developer/Library/Frameworks/XCTest.framework
 Xcode511.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Developer/Library/Frameworks/XCTest.framework

 Xcode601.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework
 Xcode601.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework
 Xcode601.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-03-24 11:23:40 -04:00
Brad King 7ef5f240c8 Merge topic 'lib64_paths_crosscompiling'
81bfebfe Linux: Ignore Debian-specific case when cross-compiling
2015-03-23 09:22:06 -04:00
Zack Galbreath 81bfebfe8c Linux: Ignore Debian-specific case when cross-compiling
When constructing settings for the target environment during cross
compiling we should not check for /etc/debian_version on the host.
2015-03-23 09:19:54 -04:00
Brad King 00842df48d PGI: Remove invalid -fPIE flag (#15460)
The PGI compilers on Linux do not have the -fPIE flag.  Remove the table
entry added by commit v2.8.9~125^2~2 (Add platform variables for
position independent code flags, 2012-05-05), which likely included it
only as part of a sweeping introduction of such flags.
2015-03-20 12:59:54 -04:00
Todd Gamblin 13807bcb41 BlueGene/Q Platform files
- based on the BlueGene/P platform files.
- tested by Todd Gamblin (LLNL) and David DeMarle (Kitware)
2015-03-18 23:40:12 -07:00
Brad King 4817d2814a Merge topic 'windows-rc-enable-later'
772eae44 RC: Add platform-specific preprocessor definitions (#15404)
4300de3e RC: Enable language after C, CXX, or Fortran is enabled (#15404)
1de4a0fb RC: Drop unused CMAKE_COMPILE_RESOURCE variable setting
2015-02-26 08:52:09 -05:00
Brad King 772eae4464 RC: Add platform-specific preprocessor definitions (#15404)
In Platform/Windows-MSVC the C and CXX flags are initialized to
contain preprocessor definitions describing the platform.  On
WinCE platforms this may not be just -DWIN32.  This information
may be important to RC sources too, so add such preprocessor
definitions to the default RC flags.

Suggested-by: Gunnar Roth <gunnar.roth@gmx.de>
2015-02-25 11:29:45 -05:00
Brad King 4300de3e27 RC: Enable language after C, CXX, or Fortran is enabled (#15404)
The RC language is special in that it is automatically enabled
on Windows-based platforms when another primary language is
enabled.  Move enablement of RC from early in the enablement
of the other language to late.  This will allow it to use
information detected as part of enabling C, CXX, or Fortran.
2015-02-25 11:16:51 -05:00