Commit Graph

424 Commits

Author SHA1 Message Date
David Cole 8d88de4b4a Fix issue with SDK not matching initial deployment target chosen by setting the MACOSX_DEPLOYMENT_TARGET environment variable. The problem was that we were setting the initial SDK value based on our own internal default value for deplyment target rather than the user's environment variable choice. The solution is to base the default value for the SDK on the deployment target variable after initially caching the deployment target... Every time I'm in this code I think I leave it cleaner, only to be proven otherwise. Let's give this one a whirl. Bleh. 2009-12-23 12:08:25 -05:00
David Cole a830786c44 Fix issues #9959 and #9898 - do not set CMAKE_OSX_DEPLOYMENT_TARGET if CMAKE_OSX_SYSROOT is set.
Default to "" for CMAKE_OSX_DEPLOYMENT_TARGET if CMAKE_OSX_SYSROOT is set. Also, add new error message to detect the case where there is a deployment target, but no SDK has been set. Fix args to STRING REGEX call so that it works even if _sdk_path variable is empty inside sanity check function.
2009-12-15 11:10:15 -05:00
Brad King af14f1f2c3 Remove GNU-specific flags from Linux.cmake
We remove the shared library compile/link flags "-fPIC" and "-shared"
because they are not provided by all compilers on Linux.  This allows us
to drop code from the Linux-XL-*.cmake files that erases the bad flags.
All other supported compilers already provide their correct flags for
Linux in their own platform information files.
2009-12-04 10:22:30 -05:00
Brad King c106cb2e2f Generalize support for Portland Group Compiler
We factor flags from Platform/Linux-PGI-Fortran.cmake into language
independent helper modules

  Compiler/PGI.cmake
  Platform/Linux-PGI.cmake

and invoke the macros from

  Compiler/PGI-<lang>.cmake
  Platform/Linux-PGI-<lang>.cmake

This enables general support for the PGI compilers.
2009-12-04 10:21:57 -05:00
Brad King 2d948e94bf Remove duplicate info from Linux SunPro info files
The CMAKE_DL_LIBS variable is set platform-wide by Linux.cmake so we do
not need to duplicate it in Linux-SunPro-<lang>.cmake files.
2009-12-04 09:20:59 -05:00
Brad King e208397976 Consolidate Linux Intel compiler information
We consolidate duplicate code from Platform/Linux-Intel-<lang>.cmake
files into a macro defined in Platform/Linux-Intel.cmake.
2009-12-04 09:20:24 -05:00
Brad King 77ded39645 Fix GNU C and Fortran flags on SunOS
The commit "Split GNU compiler information files" intended to move GNU
flags from the platform-wide Platform/SunOS.cmake module into

  Platform/SunOS-GNU-<lang>.cmake

using a helper module Platform/SunOS-GNU.cmake to consolidate flags.
However, it accidentally put Fortran flags in the C language module and
left out the Fortran module altogether.  This fixes those mistakes.
2009-12-04 08:51:46 -05:00
Brad King 3e37ca8ecc Move GNU flags from SunOS.cmake to SunOS-GNU.cmake
The GNU-specific link-type flags do not belong in the platform-wide
file.
2009-12-02 16:58:52 -05:00
Brad King 4d72006bd6 Reduce duplication in Platform/<os>.cmake files
Several platform-wide linker flag variables are defined in
Modules/Platform/<os>.cmake files for C and then copied by the
Modules/CMake<lang>Information.cmake file for each language.
We now use this approach for the variables

  CMAKE_EXE_EXPORTS_${lang}_FLAG
  CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG
  CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS

to avoid duplication for multiple languages in each platform file.
2009-12-02 15:17:53 -05:00
Brad King 58d6057a52 Fix OS X dylib and module GNU flags
The commit "Split GNU compiler information files" broke the settings of

  CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS
  CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS

and started using just "-shared" for them.  This worked when tested on newer
Mac machines, but older ones really need "-dynamiclib" and "-bundle" (which are
the documented flags anyway).
2009-12-02 15:09:03 -05:00
Brad King aff3147917 Modernize GNU compiler info on Windows
This moves GNU compiler info on Windows into new-style modules

  Platform/Windows-GNU-<lang>.cmake

using language-independent helper module

  Platform/Windows-GNU.cmake

to define macros consolidating the information.
2009-12-02 11:27:59 -05:00
Brad King e28c16b482 Split GNU compiler information files
This moves GNU compiler flags into new-style modules

  Compiler/GNU-<lang>.cmake
  Platform/<os>-GNU-<lang>.cmake

We use language-independent helper modules

  Compiler/GNU.cmake
  Platform/<os>-GNU.cmake

to define macros consolidating the information.
2009-12-02 09:52:00 -05:00
Brad King 1f06c33f8e Drop -rdynamic from Linux build rules
This is a GNU-specific option that should not be specified for all
compilers on Linux.  It tells the GNU compiler to pass -export-dynamic
to the linker to export symbols from executables for use by plugins.
Since we provide the ENABLE_EXPORTS target property to do the same thing
in a cross-platform way, there is no need to pass -rdynamic always.

Since the option is not useful for GNU tools and breaks other tools on
Linux we simply remove it from CMAKE_SHARED_LIBRARY_LINK_<lang>_FLAGS.
This also allows us to stop setting the variable in other Linux compiler
files just to erase the bad flag.

See issue #9985.
2009-12-01 14:25:21 -05:00
Brad King 4f43c1f276 Singly-quote target names for Watcom linker
The Watcom tools do their own command-line parsing and do not accept
double-quotes.  Instead we single-quote the target output name when
invoking wlink and other Watcom tools.  This fixes support for spaces in
the target output directory path when it is not under the build tree.
2009-11-30 11:16:24 -05:00
Bill Hoffman 4430bccc70 Change the way 32/64 bit compiles are detected with MSVC and intel makefile builds. Use the platform ID preprocessor approach. 2009-11-19 21:58:42 -05:00
Brad King 537906b467 Fix flags for Intel Fortran on Windows
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.
2009-10-29 10:06:10 -04:00
Brad King ccdd3e943d Fix Intel Fortran SHARED libraries on Linux
The Intel Fortran compiler needs options '-i_dynamic' and '-nofor_main'
to create shared libraries on Linux (for at least one architecture).
2009-10-27 10:50:43 -04:00
Brad King 707d05e936 Fix Intel and MinGW Fortran DLL import libraries
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.
2009-10-26 11:07:27 -04:00
Brad King 0653286dc6 Split Borland compiler information files
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.
2009-10-08 11:56:07 -04:00
Bill Hoffman 0556075034 Teach intel compiler on windows to place .lib files and .pdb files. 2009-10-05 13:17:53 -04:00
Bill Hoffman 57ece74730 Teach intel compiler on windows to place .lib files and .pdb files. 2009-10-05 12:49:51 -04:00
Brad King f98a4e63fd Avoid (Unix|Windows)Paths.cmake multiple include
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.
2009-10-05 11:47:25 -04:00
Brad King 3dc80f8d8c Add copyright notice to (Unix|Windows)Paths.cmake
This commit adds our copyright notice to these non-trivial platform
modules.
2009-10-05 11:47:05 -04:00
Brad King c118fd4c55 Find locally installed software first
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.
2009-10-05 11:09:15 -04:00
Brad King 451d68b7e3 Support GNU/kFreeBSD
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.
2009-10-05 10:26:50 -04:00
Brad King c513962701 Create INTERPROCEDURAL_OPTIMIZATION build feature
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.
2009-10-02 13:52:13 -04:00
Brad King d455eeb6d7 Fix typo in Intel xiar search code
This renames the variable '_intel_xair_hints' to '_intel_xiar_hints'.
2009-10-02 13:24:32 -04:00
Brad King 6d434ee6cc Split XL compiler information files
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.
2009-09-30 09:37:35 -04:00
Brad King f40406ed6b Fix default install prefix on Haiku
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.
2009-09-30 08:31:53 -04:00
Brad King 869440f75a Fix shared library creation flag for XL on Linux
See issue #9617.
2009-09-29 13:56:57 -04:00
Brad King 180c60a86f Fix check for -isysroot on OS X
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.
2009-09-19 10:14:31 -04:00
Bill Hoffman 58818d5168 Add detection of gcc versions that do not support isysroot option and do not use it for them. 2009-09-18 14:22:20 -04:00
Bill Hoffman ea282284d5 Fix for bug #9466. Change the implementation of OSX arch lists. If no ARCHs are specified by the user then no flags are set. We no longer use CMAKE_OSX_ARCHITECTURES_DEFAULT. 2009-09-17 11:53:02 -04:00
Brad King b5e558e291 Fix XL C++ compiler flags on Linux
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.
2009-09-16 12:33:24 -04:00
Bill Hoffman 8710cc6422 Add support for embeded manifests for Intel C/C++/Fortran compilers 2009-09-01 16:33:51 -04:00
Bill Hoffman 76d059e3fb Add a module to determine if the intel linker supports manifest creation 2009-09-01 16:23:07 -04:00
Bill Hoffman e9a170b108 Move /MANIFEST flag into -E vs_link. This is so it can be used by the intel compilers without having to specifiy it in the intel compiler files 2009-09-01 14:33:26 -04:00
Brad King 2eca4dd2d1 Use Intel for Linux flags only on Linux
The commit "Split Intel compiler information files" moved some Linux
specific flags into the platform-independent Intel compiler info files.
This moves them back.
2009-09-01 13:55:13 -04:00
Brad King 9ee0f9801a Split SunPro compiler information files
This moves platform-independent SunPro compiler flags into separate
"Compiler/SunPro-<lang>.cmake" modules.  Platform-specific flags are
left untouched.
2009-08-21 10:32:26 -04:00
Brad King 2ce6a7d0fb Split Intel compiler information files
This moves platform-independent Intel compiler flags into separate
"Compiler/Intel-<lang>.cmake" modules.  Platform-specific flags are
left untouched.
2009-08-21 09:54:42 -04:00
Brad King 45313dc943 Quote the target name for Borland tlib tool
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.
2009-08-12 09:09:41 -04:00
Brad King 115ecc5750 Teach compiler id about VisualAge -> XL rebranding
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.
2009-08-07 10:13:07 -04:00
Brad King 34c6588b6e Move flag to Compiler/VisualAge-Fortran module
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.
2009-08-07 10:12:34 -04:00
Brad King ee7231c03f Use NetBSD to initialize OpenBSD configuration
We teach Modules/Platform/OpenBSD.cmake to load NetBSD first since the
platforms are so similar.  This enables RPATH support on OpenBSD.
2009-08-07 09:56:20 -04:00
Brad King 071ce33ec9 ENH: Install all Modules and Templates
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.
2009-07-24 13:17:41 -04:00
Bill Hoffman d10d57fedd ENH: remove debug message 2009-07-15 12:43:09 -04:00
Bill Hoffman 6d80f66456 ENH: do not use /INCREMENTAL:YES with VS 10 compiler 2009-07-15 12:18:37 -04:00
Brad King 82c081ba35 BUG: Fix rpath-link flag for SunPro C++ on Linux
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.
2009-07-13 10:40:15 -04:00
Brad King b4b52451ae BUG: Look in arch-specific HPUX implicit link dirs
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.
2009-06-19 17:09:36 -04:00
Bill Hoffman b6fc0a78ff ENH: put the 64 bit paths first 2009-06-15 13:17:54 -04:00