Move HP flags out of Platform/HP-UX.cmake into platform-specific
compiler information files "Platform/HP-UX-HP-<lang>.cmake". Factor
common values into "Platform/HP-UX-HP.cmake" and load it from the
per-language files.
Move RPATH flags out of Platform/AIX.cmake into platform-specific
compiler information files Platform/AIX-XL and Platform/AIX-GNU.
The flags need to be set for each compiler of each language.
Commit 6a61a8a5 (Honor module .def files with MinGW tools, 2011-02-21)
set CMAKE_LINK_DEF_FILE_FLAG to "-Wl," to enable passing .def files to
the linker on MinGW. However, older GNU tools in the MSYS shell do not
know how to translate "-Wl,/c/..." to "c:/..." and complain that the
file does not exist. Instead set the flag to just "" which tells CMake
it can pass the file through the front-end with no special flag.
Since commit 024d05ad (Fix use of module .def files for MS tools,
2009-09-29) module .def files work for any platform that sets
CMAKE_LINK_DEF_FILE_FLAG correctly. Set it in the Windows-GNU platform
information file to enable support with MinGW tools. Also enable the
test added by commit 0db2c850 (Test use of module .def files for MS
tools, 2009-09-29) for MinGW and MSYS generators.
971692c Build enable_language command during bootstrap
960ace1 Add testing for windows resources for mingw/msys/cygwin and remove for watcom.
060d6e8 Add support for windres to cygwin.
b2f308c Add support for windows resources with mingw/msys.
The Mac linker defines flag -headerpad_max_install_names but not all
front-ends recognize the flag and pass it through (many did in the past,
such as the Apple port of GCC). Use the -Wl, option prefix to tell
front-ends to pass it through without trying to interpret it.
One of Cygwin's goals is to build projects using the POSIX API with no
Windows awareness. Many CMake-built projects have been written to test
for UNIX and WIN32 but not CYGWIN. The preferred behavior under Cygwin
in such projects is to take the UNIX path but not the WIN32 path.
Unfortunately this change is BACKWARDS INCOMPATIBLE for Cygwin-aware
CMake projects! Some projects that previously built under Cygwin and
are Cygwin-aware when they test for WIN32 may now behave differently.
Eventually these projects will need to be updated, but to help users
build them in the meantime we print a warning about the change in
behavior. Furthermore, one may set CMAKE_LEGACY_CYGWIN_WIN32 to request
old behavior during the transition.
Normally we avoid backwards incompatible changes, but we make an
exception in this case for a few reasons:
(1) This behavior is preferred by Cygwin's design goals.
(2) A warning provides a clear path forward for everyone who may see
incompatible behavior, and CMAKE_LEGACY_CYGWIN_WIN32 provides a
compatibility option. The warning and compatibility option both
disappear when the minimum required version of CMake in a project is
sufficiently new, so this issue will simply go away over time as
projects are updated to account for the change.
(3) The fixes required to update projects are fairly insignificant.
Furthermore, the Cygwin distribution has no releases itself so project
versions that predate said fixes tend to be difficult to build anyway.
(4) This change enables many CMake-built projects that did not
previously build under Cygwin to work out-of-the-box. From bug #10122:
"I have built over 120 different source packages with (my patched)
CMake, including most of KDE4, and have found that NOT defining
WIN32 on Cygwin is much more accurate." -- Yaakov Selkowitz
A fully compatible change would require patches on top of these project
releases for Cygwin even though they otherwise need not be aware of it.
(5) Yaakov has been maintaining a fork of CMake with this change for the
Cygwin Ports distribution. It works well in practice. By accepting the
change in upstream CMake we avoid confusion between the versions.
CMake itself builds without WIN32 defined on Cygwin. Simply disable
CMAKE_LEGACY_CYGWIN_WIN32 explicitly in our own CMakeLists.txt file.
09d1c10 FortranCInterface: Recognize NAG Fortran module symbols
af2ad90 Add NAG Fortran compiler information files
24cc3d4 Recognize the NAG Fortran compiler
83892c4 Allow Fortran platform files to set empty values
fe3f878 Detect object files in implicit link information
Since commit aff31479 (Modernize GNU compiler info on Windows,
2009-12-02) the file Modules/Platform/Windows-g++.cmake has been unused.
It just includes the non-existent Modules/Platform/Windows-gcc.cmake so
remove it outright.
This moves Intel compiler info on Windows into new-style modules
Platform/Windows-Intel-<lang>.cmake
using language-independent helper module
Platform/Windows-Intel.cmake
to define macros consolidating the information.
Commit 4430bccc (Change the way 32/64 bit compiles are detected with
MSVC and intel, 2009-11-19) added detection of the target processor to C
and CXX language builds with MS and Intel tools. Do the same for Intel
Fortran for Windows (ifort). Use /machine:<arch> to link executables.
On Linux the NAG Fortran compiler uses gcc under the hood to link. Use
"-Wl,-v" to pass "-v" to the underlying gcc compiler to get verbose link
output. Detect the NAG Fortran directory (using -dryrun) and then honor
object files in the directory referenced in the implicit link line.
Pass real linker options with "-Wl,-Xlinker,". The -Wl, gets through
the NAG front-end and the -Xlinker gets through the gcc front-end.
The Mac linker defines -headerpad_max_install_names and the GCC
front-end passes this flag through. The PGI compiler does not know
about this flag, so we must use -Wl,-headerpad_max_install_names to pass
it to the linker instead.
Use a combination of response files and the archiver to support long
object file lists that do not fit in the Windows command-line length
limit. This can work only with GCC >= 4 because the MinGW GCC 3.x
front-ends do not support response-file syntax.
Set CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH in the HP-UX platform file to
tell CMake to pass -Wl,+b,/usr/lib no matter whether RPATH is enabled or
not. This corrects the behavior of -Wl,+nodefaultrpath to look in this
default library path as documented.
Include this prefix in CMAKE_SYSTEM_PREFIX_PATH so that it will be used
for all find* commands. Previously only find_library and find_path
would look under /opt/local/lib and /opt/local/include, respectively.
BlueGeneP-base: Internal base shared by static and dynamic files
BlueGeneP-static: Platform file for all-static builds
BlueGeneP-dynamic: Platform file for "default" dynamic builds
Use response files for C and CXX languages with the Intel compiler on
Windows. We already used them for Fortran. This enables creation of
libraries and executables with a very large number of object files.