We replace "/MD" with ifort-specific flags as follows:
/MD -> /threads /libs:dll
/MDd -> /threads /libs:dll /dbglibs
We also enable the "/MD" equivalent for all Fortran configurations.
Previously multithreaded dll runtimes were used for release builds and
threaded static runtimes for debug builds. For mixed Fortran C/C++
projects, this led to link warnings for Debug but not for Release.
See issue #8744.
We add Intel and MinGW Fortran linker options to create the import
library portion of a DLL. This allows other binaries to link to a
Fortran DLL.
We also update the Fortran test to use a .def file to specify exports
since there is no __declspec(dllexport) markup syntax in Fortran.
This commit re-writes Borland compiler build rules. We split the rules
into modern <os>-<id>-<lang> information modules but share a common
macro between languages to avoid duplication.
We also address a bug in the previous rules that would build some target
types against the static Borland runtime and others against the shared
Borland runtime in one build tree. Now we always use the shared runtime
as is the default in the rules for MS tools.
Block multiple inclusion because "Modules/CMakeCInformation.cmake"
includes "Platform/${CMAKE_SYSTEM_NAME}" even though the generic
module "CMakeSystemSpecificInformation.cmake" already included it.
The extra inclusion is a work-around to address issue #4772 without
intrusive platform file changes. Once those changes are made the
work-around and these include blockers can be removed. See issue #9656.
This commit re-orders the search path prefix list from
/
/usr
/usr/local
to
/usr/local
/
/usr
so that locally-installed software is preferred.
This makes the search consistent with the Filesystem Hierarchy Standard:
http://www.pathname.com/fhs/
See issue #9657.
GNU/kFreeBSD = FreeBSD kernel + userspace with glibc. Linux.cmake
doesn't contain anything too OS specific, so we can forward to it.
Here are outputs of /bin/uname on author's machine:
uname -p ==> i386
uname -o ==> GNU/kFreeBSD
uname -s ==> GNU/kFreeBSD
uname -r ==> 5.4-1-686
Patch from Modestas Vainius. See issue #9659.
This commit creates target and directory properties to enable the Intel
interprocedural optimization support on Linux. Enabling it adds the
compiler option '-ipo' and uses 'xiar' to create archives.
See issue #9615.
This moves platform-independent XL compiler flags into separate
"Compiler/XL-<lang>.cmake" modules. Platform-specific flags go in
"Platform/<os>-XL-<lang>.cmake" modules.
Since Haiku does not have /usr (and therefore /usr/local), this commit
changes the default install prefix to the equivalent directory of
/boot/common.
See issue #9607.
Previously we checked for this flag by parsing the version number of GCC
out of 'gcc --version', but this is not reliable because the format can
vary greatly. Now we run 'gcc -v --help' and look for '-isysroot' in
the list of options.
We also now store the result on a per-language basis in the per-compiler
info file "CMake<LANG>Compiler.cmake". This is necessary to make it
accessible from try-compile projects so that they generate correctly.
In Platform/Linux.cmake we add GNU flags as default for the platform
which breaks non-GNU compilers. Later we should refactor these flag
files to put compiler-specific flags only in files loaded for each
compiler. Until then this commit fixes the XL C++ compiler flags on
Linux by erasing the GNU flags. See issue #9469.
The commit "Split Intel compiler information files" moved some Linux
specific flags into the platform-independent Intel compiler info files.
This moves them back.
This moves platform-independent SunPro compiler flags into separate
"Compiler/SunPro-<lang>.cmake" modules. Platform-specific flags are
left untouched.
The Borland librarian tool "tlib" requires that the output target name
be quoted if it contains the character '-' (and perhaps a few others).
This commit restores the use of the TARGET_QUOTED rule variable
replacement for this purpose. Otherwise no static library can have a
'-' in its name.
This problem was exposed by the 'Testing' test when it builds the
pcStatic library with the '-dbg' suffix.
IBM rebranded its VisualAge compiler to XL starting at version 8.0. We
use the compiler id "XL" for newer versions and "VisualAge" for older
versions. We now also recognize the "z/OS" compiler, which is distinct
from XL.
The CMAKE_Fortran_DEFINE_FLAG value applies to the IBM Fortran compilers
on all platforms. This moves the setting to the platform-independent
compiler information file.
This removes the file-wise installation rules for Modules and Templates
and instead installs the whole directories. This approach is much less
error-prone. The old approach was left from before CMake had the
install(DIRECTORY) command.
This teaches Modules/Platform/Linux-SunPro-CXX.cmake the -rpath-link flag. The
SunPro C++ compiler does not have a '-Wl,' option, so we just pass the flag
directly.
This problem was exposed by the ExportImport test now that it links an
executable through the C++ compiler with the -rpath-link flag.
On HP-UX machines some system libraries appear in architecture-specific
implicit linker search paths. We need to add these paths to our system
library search path. However, at the time we construct the search path
we do not know the target architecture.
A full solution requires re-organizing platform configuration files so
that the target architecture can be known when needed. Until that
happens we can avoid the problem by searching in both 32-bit and 64-bit
implicit link directories. By telling CMake that they are implicit
directories the generated link lines will never pass the paths, leaving
the linker free to find the library of the proper architecture even if
the find_library call finds the wrong one.
This adds the Modules/Platform/OpenVMS.cmake platform file for OpenVMS.
We just use Unix-like rules to work with the GNV compiler front-end.
A problem with process execution currently prevents CMake link scripts
from working, so we avoid using them.
HP-UX uses both .sl and .so as extensions for shared libraries. This
teaches CMake to recognize .so shared libraries so they are treated
properly during link dependency analysis.
This enables the --enable-auto-import linker flag on Cygwin when linking
executables. It works with the old gcc 3.x compiler and is necessary
for the new gcc 4.x compiler. See issue #9071.
This creates variable CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to
specify implicit include directories on a per-language basis. This
replaces the previous platform-wide variable. It is necessary to
avoid explicit specification of -I/usr/include on some compilers
(such as HP aCC) because:
1.) It may break ordering among system include directories defined
internally by the compiler, thus getting wrong system headers.
2.) It tells the compiler to treat the system include directory
as a user include directory, enabling warnings in the headers.
See issue #8598.
We used to suppress generation of -I/usr/include (and on OSX also
-I/usr/local/include). This behavior seems to cause more trouble than
it's worth, so I'm removing it until someone encounters the original
problem it fixed. See issue #8598.
Some OS X linkers want a 'dylib_' prefix on the -compatiblity_version
and -current_version flags while others do not. This passes the flags
through gcc instead since it never wants the prefix and translates the
flags for the linker correctly.