summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'wince800'Brad King2013-08-081-1/+5
|\ | | | | | | | | | | 0416a0e VS11: Add support for Windows CE SDKs 8fcf0ab Add support for new Windows CE compiler
| * Add support for new Windows CE compilerPatrick Gansterer2013-08-071-1/+5
| | | | | | | | | | The new compiler versions do not need corelibc.lib as a default link library and a architecture detection workaround.
* | Merge topic 'osx-no-command-line-tools'Brad King2013-08-071-0/+6
|\ \ | |/ |/| | | | | 03ab170 OS X: Enable command-line build without tools in PATH
| * OS X: Enable command-line build without tools in PATHBrad King2013-08-061-0/+6
| | | | | | | | | | | | | | | | | | | | Teach modules CMakeDetermineCompiler and CMakeUnixFindMake to ask Xcode where to find the compiler or make tools, using 'xcrun --find', if none is found in the PATH. Teach module Platform/Darwin to add the path to the SDK to CMAKE_SYSTEM_PREFIX_PATH so that find_* command look there. Also add the SDK /usr/include directory to the implicit include list in CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES to suppress explicit -I options for it.
* | WIN: Use COFF file header header for architecture detection (#14083)Patrick Gansterer2013-08-051-7/+0
|/ | | | | Read the machine field from the COFF file header to get the exact target architecture for ARM and SHx on the Windows platform.
* OS X: Search for SDK based on deployment target (#14324)Brad King2013-08-021-1/+5
| | | | | | | | When available, use CMAKE_OSX_DEPLOYMENT_TARGET instead of the host OS X version to select the default SDK. This makes sense because one should use the SDK matching the deployment target. Suggested-by: John Ralls <jralls@ceridwen.us>
* OS X: Add Fortran library version flags (#14249)Graham Markall2013-07-164-0/+31
| | | | | | | | | The linker flags for setting the compatibility and current versions of libraries on Darwin are set for the supported Fortran compilers. Set CMAKE_Fortran_CREATE_SHARED_LIBRARY for the NAG Fortran compiler to have no space after <SONAME_FLAG> so the NAG compiler can parse the argument correctly.
* OS X: Add copyright notices to Darwin-*-Fortran.cmakeBrad King2013-07-163-0/+39
|
* Merge branch 'master' into vs12-generatorBrad King2013-06-287-21/+23
|\ | | | | | | | | Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping the side from 'master'.
| * Embarcadero: Use response files only for includes, objects, and libsBrad King2013-06-271-3/+4
| | | | | | | | | | | | Leave other flags directly in the Makefile command lines and outside any special inline response file syntax. Otherwise Borland does not support flags with quotes in response files.
| * Add compiler target compile options.Stephen Kelly2013-06-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Merge topic 'rpath-on-mac'Brad King2013-06-031-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | dc1d025 OS X: Add test for rpaths on Mac. 8576b3f OS X: Add support for @rpath in export files. 00d71bd Xcode: Add rpath support in Xcode generator. 94e7fef OS X: Add RPATH support for Mac.
| | * OS X: Add RPATH support for Mac.Clinton Stimpson2013-06-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | RPATH support is activated on targets that have the MACOSX_RPATH property turned on. For install time, it is also useful to set INSTALL_RPATH to help find dependent libraries with an @rpath in their install name. Also adding detection of rpath conflicts when using frameworks.
| * | Merge topic 'xcode-shlib-versioning'Brad King2013-06-031-6/+2
| |\ \ | | |/ | | | | | | | | | cbe3f20 Xcode: Add support for shared library versioning
| | * Xcode: Add support for shared library versioningClinton Stimpson2013-05-291-6/+2
| | | | | | | | | | | | | | | Add a post-build command to shared library targets to create the versioning symbolic links.
| * | Merge topic 'vs-configurations'Brad King2013-05-162-5/+0
| |\ \ | | | | | | | | | | | | | | | | 42bb42d VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generators
| | * | VS: Always initialize CMAKE_CONFIGURATION_TYPES in IDE generatorsBrad King2013-05-132-5/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize the CMAKE_CONFIGURATION_TYPES cache entry early during EnableLanguage like the Xcode generator does. Avoid depending on the MSVC compiler information module to do it. Otherwise code like project(MyProj NONE) sets CMAKE_CONFIGURATION_TYPES late (in GenerateConfigurations), and to only "Debug" and "Release" instead of the standard set of 4. Reported-by: Paul Smith <paul@mad-scientist.net>
| * | Merge topic 'doc-improvements'Brad King2013-05-161-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used" 2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames 56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) 2bab472 VS10: add detailed comment about MIDL processing e619111 Explain distribution of Win9x binary on all Windows versions. 5ca4336 FindwxWidgets: add DOC strings with usual style f57800d Fix spelling and typos (product names) bf019d7 Fix spelling and typos (non-binary) ddac8d3 Fix spelling and typos (affecting binary data / module messages) 86832ce Fix spelling and typos (affecting users)
| | * | Fix spelling and typos (non-binary)Andreas Mohr2013-05-071-1/+1
| | |/
| * | Merge topic 'WindowsPaths-MinGW-cross-compile-only'Brad King2013-05-161-2/+4
| |\ \ | | | | | | | | | | | | | | | | f9eee7f Windows: Search '/' prefix only when cross compiling (#10994)
| | * | Windows: Search '/' prefix only when cross compiling (#10994)Brad King2013-04-251-2/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dac78148 (...makes the mingw cross compiler work out of the box..., 2007-08-02) added to CMAKE_SYSTEM_PROGRAM_PATH and CMAKE_SYSTEM_LIBRARY_PATH paths like "/bin" and "/lib" with no Windows drive letter so that cross-compiling to Windows from Linux would search these paths under CMAKE_FIND_ROOT_PATH. Later commit 2a782880 (...use CMAKE_SYSTEM_PREFIX_PATH when possible, 2008-01-16) generalized this approach by instead adding "/" to CMAKE_SYSTEM_PREFIX_PATH. Both commits assumed that the paths would never match anything on Windows hosts without a drive letter. However, Windows evaluates these paths relative to the current working drive letter so find_* commands may report paths like "/lib/..." when paths like "c:/lib/..." exist on what happens to be current drive. Such drive-less paths are not reliable when the working drive changes, so we should not use them. Fix WindowsPaths.cmake to add '/' to CMAKE_SYSTEM_PREFIX_PATH only when cross-compiling to Windows from a non-Windows host. This will avoid searching and finding local paths without a drive letter on Windows.
| * | MSVC: Invoke 'link' directly for executablesBrad King2013-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the CMAKE_<LANG>_LINK_EXECUTABLE rule variable to invoke the linker directly instead of through the compiler. We already do this for DLL linking with CMAKE_<LANG>_CREATE_SHARED_LIBRARY. This also works around a VS 6 cl bug. While invoking the link tool internally it fails to correctly quote flags like /pdb:... with spaces in the value.
| * | VS: Separate compiler and linker PDB files (#11899, #14062)Brad King2013-04-052-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MS tools create two types of PDB files as explained here: http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.71%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.90%29.aspx http://msdn.microsoft.com/en-us/library/yd4f8bd1%28v=vs.100%29.aspx One is created by the compiler (/Fd) and the other by the linker (/pdb). The two options should not specify the same file. Split them up. In the VS IDE generators, simply drop ProgramDataBaseFileName to take the VS default "/Fd$(IntDir)vc$(PlatformToolsetVersion).pdb". In the Makefile generators, set "/Fd" on the compile line to be the directory containing object files (with a trailing slash the compiler will add the "vc$(PlatformToolsetVersion).pdb" filename automatically). Drop the /Fd option from the exe link command line and add "/pdb" instead (already done for dll linking). Update these rules for both MSVC and Intel tools. Drop support for PDB_OUTPUT_DIRECTORY and PDB_NAME in STATIC libraries because the generated .pdb files are only from /Fd and not real linker-generated .pdb files. Update documentation to clarify that the PDB_* properties are only for linker .pdb files. This regresses the PDBDirectoryAndName test for STATIC libraries. Since it is not clear at this time what should be done for STATIC library .pdb files, comment out the relevant portion of the test and leave a TODO comment.
* | VS12: Add Visual Studio 12 generator (#14251)Brad King2013-06-281-1/+4
|/ | | | | | | | | | | | | | Copy cmGlobalVisualStudio11Generator to cmGlobalVisualStudio12Generator and update version numbers accordingly. Add the VS12 enumeration value. Add module CMakeVS12FindMake to find MSBuild. Look for MSBuild in its now-dedicated Windows Registry entry. Teach the platform module Windows-MSVC to set MSVC12 and document the variable. Teach module InstallRequiredSystemLibraries to look for the VS 12 runtime libraries. Teach tests CheckCompilerRelatedVariables, Preprocess, VSExternalInclude, and RunCMake.GeneratorToolset to treat VS 12 as they do VS 10 and 11. Inspired-by: Minmin Gong <minmin.gong@gmail.com>
* Merge topic 'aix-shared-flags'Brad King2013-03-122-2/+2
|\ | | | | | | | | bce7a2a AIX: Do not use -brtl to create shared libraries (#13997)
| * AIX: Do not use -brtl to create shared libraries (#13997)Brad King2013-03-112-2/+2
| | | | | | | | | | | | | | | | | | | | The flag was added incorrectly by commit 9c3a6eb4 (Need -brtl when creating shared libraries, 2003-05-16). According to "man ld" the -G option implies "-brtl -bnortllib ...", -brtl implies "-brtllib", and -brtllib should only be used for executables, not shared libraries. Therefore it is incorrect and unnecessary to specify -brtl explicitly after -G. Reported-by: Kevin Burge <kcburge@gmail.com>
* | Merge topic 'rpath-use-implicit-link-dirs'Brad King2013-02-151-0/+1
|\ \ | | | | | | | | | | | | | | | | | | 95a9c80 Merge topic 'LINK_LIBRARIES-property' into rpath-use-implicit-link-dirs baa33ac AIX-GNU: Put implicit link directories in runtime libpath (#13909) 171b099 Avoid duplicate RPATH entries
| * \ Merge topic 'LINK_LIBRARIES-property' into rpath-use-implicit-link-dirsBrad King2013-02-146-30/+52
| |\ \ | | | | | | | | | | | | Resolve a logical conflict in the signature of cmTarget::GetLinkClosure.
| * | | AIX-GNU: Put implicit link directories in runtime libpath (#13909)Brad King2013-02-141-0/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GNU compiler front-ends on AIX invoke the linker with flags of the form "-L/path/to/gnu/runtime/lib" to tell ld where to find the language runtime libraries. They depend on the default libpath behavior documented in "man ld" to add the -L paths also to the runtime libpath so the dynamic loader can find the language runtime libraries. This differs from platforms whose linkers have distinct -rpath flags that non-system compilers can use to tell the dynamic loader where to find their language runtime libraries. Since commit 96fd5909 (Implement linking with paths to library files, 2008-01-22) CMake always passes "-Wl,-blibpath:" followed by any project-defined RPATH plus "/usr/lib:/lib" in order to explicitly set the runtime libpath and avoid getting all the project -L paths in the runtime libpath. The explicit libpath prevents the GNU compiler runtime library -L paths from being placed in the libpath and then the dynamic loader fails to find the language runtime libraries. CMake already detects the implicit link directories for each language since commit 07ea19ad (Implicit link info for C, CXX, and Fortran, 2009-07-23). Add the implicit link directories to the explicit runtime libpath for GNU compilers on AIX to fix this use case.
* | | Embarcadero: Fix default link stack/heap flags (#13912)Brad King2013-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit c70beb4b (change the default borland stack size, 2003-05-05), commit 1b572eb9 (remove -H flags, 2003-05-08), and commit 2d411398 (Stack size in generated programs should be 10 meg, 2003-06-12) CMake adds link flags to select a 10MB stack. At the time this was for consistency with our behavior on MS, but that was recently removed by commit 51af1da3 (Remove "/STACK:10000000" from default linker flags, 2012-11-23). Change our Embarcadero link flags to select the default stack and heap settings according to the compiler documentation. This is more reliable than leaving the flags out completely as it has been reported that the linker does not always use its documented defaults. Suggested-by: Mathäus Mendel <contato@mathausmendel.com>
* | | MSVC: Fix CMAKE_CL_64 in CXX-only projects (#13896)Brad King2013-02-071-1/+1
| | | | | | | | | | | | | | | When CXX is enabled without C then MSVC_CXX_ARCHITECTURE_ID is set instead but not MSVC_C_ARCHITECTURE_ID. Test both.
* | | Set WINCE to 1 when building for WindowsCEPatrick Gansterer2013-02-011-2/+3
| | | | | | | | | | | | | | | Introduce a new variable WINCE to make the WindowsCE system more easy to use in if statements.
* | | OS X: Detect implicit linker framework search pathsBrad King2012-12-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we hard-coded a list of implicit framework directories but did not account for CMAKE_OSX_SYSROOT or for changes to the list across OS X versions. Instead we should automatically detect the framework directories for the active toolchain. The parent commit added the "-Wl,-v" option to ask "ld" to print its implicit directories. It displays a block such as: Framework search paths: /... Parse this block to extract the list of framework directories. Detection may fail on toolchains that do not list their framework directories, such as older OS X linkers. Always treat the paths <sdk>/Library/Frameworks <sdk>/System/Library/Frameworks <sdk>/Network/Library/Frameworks # Older OS X only /System/Library/Frameworks as implicit. Note that /System/Library/Frameworks should always be considered implicit so that frameworks CMake finds there will not override the SDK copies.
* | | OS X: Detect implicit link directories on modern toolchainsBrad King2012-12-112-0/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We detect the implicit link directories for the toolchain by adding a flag to get verbose output from the compiler front-end while linking the ABI detection binary. Newer OS X toolchains based on Clang do not add the implicit link directories with -L options to their internal invocation of "ld". Instead they use a linker that comes with the toolchain and is already configured with the proper directories. Add the "-Wl,-v" option to ask "ld" to print its implicit directories. It displays them in a block such as: Library search paths: /... Parse this block to extract the implicit link directories. While at it, remove the checks introduced by commit efaf335b (Skip implicit link information on Xcode, 2009-07-23) and commit 5195a664 (Skip implicit link info for multiple OS X archs, 2009-09-22). Discard the non-system link directories added by Xcode. Discard all detected implicit libraries in the multi-architecture case but keep the directories. The directories are still useful without the libraries just to suppress addition of explicit -L options for them.
* | OpenBSD: Install shared libraries without executable permissionAmit Kulkarni2012-12-041-0/+4
| |
* | CMake: Remove "/STACK:10000000" from default linker flags (#12437)David Cole2012-11-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | Modern apps that use multiple threads do NOT want 10 Megabytes of RAM per thread being used for each thread's stack... Just leave off the /STACK: argument, and let the compiler use a reasonable default value for the stack size. If existing single-threaded apps require the /STACK: argument because they do need a very large stack size, they can add the flag in their own CMakeLists files.
* | MSVC: Drop default use of /Zm1000 for VS >= 7.1Brad King2012-11-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | From the option documentation of VS >= 7.1: "In earlier versions of Visual C++, the compiler used several discrete heaps, and each had a finite limit. Currently, the compiler dynamically grows the heaps as necessary up to a total heap size limit, and requires a fixed-size buffer only to construct precompiled headers. Consequently, the /Zm compiler option is rarely necessary." http://msdn.microsoft.com/en-us/library/bdscwf1c.aspx Suggested-by: Adam Moss <adam@broadcom.com>
* | Merge topic 'osx-bad-sdk-xcode-3.2.6'Brad King2012-11-131-0/+17
|\ \ | | | | | | | | | | | | 720d790 OS X: Warn about known SDK breakage by Xcode 3.2.6
| * | OS X: Warn about known SDK breakage by Xcode 3.2.6Brad King2012-11-081-0/+17
| |/ | | | | | | | | | | | | Xcode 3.2.6 is known to break the SDK Library/Frameworks layout. Detect and warn about this case to tell users to fix their system. Reported-by: Matthew Brett <matthew.brett@gmail.com>
| * Merge branch 'osx-sysroot-cleanup' into releaseBrad King2012-11-061-0/+1
| |\
* | \ Merge topic 'osx-sysroot-cleanup'Brad King2012-11-061-0/+1
|\ \ \ | | |/ | |/| | | | | | | 15f5764 OS X: Fix default CMAKE_OSX_SYSROOT with deployment target
| * | OS X: Fix default CMAKE_OSX_SYSROOT with deployment targetBrad King2012-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 43b74793 (OS X: Further improve default CMAKE_OSX_SYSROOT selection, 2012-09-21) we choose a default CMAKE_OSX_SYSROOT only when one is needed. However, the change forgot that we require a sysroot when a deployment target is requested. Teach Darwin.cmake to choose a default CMAKE_OSX_SYSROOT when CMAKE_OSX_DEPLOYMENT_TARGET is set. Reported-by: Matthew Brett <matthew.brett@gmail.com> Reported-by: Bradley Giesbrecht <pixilla@macports.org>
* | | BSD: Do not require dlfcn.h to build shared libs (#13573)Brad King2012-10-052-26/+22
| |/ |/| | | | | | | | | | | | | Remove ancient checks left from commit f5d95fb0 (Complete rework of makefile generators expect trouble, 2002-11-08). Modern FreeBSD and NetBSD platforms support shared libraries. When cross-compiling the /usr/include/dlfcn.h may not exist on the host but the toolchain still supports shared libraries.
* | Ninja: move <OBJECTS> in front of the first linker optionPeter Kümmel2012-10-013-3/+6
| | | | | | | | | | | | In the response file also linker options could be passed, and because <OBJECTS> is replaced by a response file, it is necessary that no compiler option follows <OBJECTS>.
* | Revert "Ninja: don't expand any rsp files"Bill Hoffman2012-10-012-11/+5
|/ | | | | | | | | This reverts commit 5598d9b2a06d4ec788b5e058435bb3bba99fd517. Since commit f1670ab1 (Ninja: don't confuse ninja's rsp files with nmake's, 2012-09-26) Ninja generator response files are placed in CMakeFiles/ so the previously existing check already avoids expanding them.
* OS X: Teach deployment target sanity check about SDK namesBrad King2012-09-221-20/+30
| | | | | | | | | Since commit 1786b121 (OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK name, 2012-09-21) we support names like "macosx" or "macosx10.7" as the specified value of CMAKE_OSX_SYSROOT. Extend the SDK name->path conversion to save the original value and also convert into a temporary variable for the Xcode generator. Re-implement the deployment target sanity check to detect the version from the transformed path.
* OS X: Further improve default CMAKE_OSX_SYSROOT selectionBrad King2012-09-211-1/+3
| | | | | | | | | Since commit 230ea218 (OS X: Improve default CMAKE_OSX_SYSROOT selection, 2012-09-21) we always set CMAKE_OSX_SYSROOT if any SDK is found in order to support Makefile generator builds with Xcode >= 4.3 without the command-line tools installed. However, in the basic POSIX-only case of the Makefile generator with command-line tools and no CMAKE_OSX_ARCHITECTURES we should not select any SDK by default.
* OS X: If CMAKE_OSX_SYSROOT is already set do not compute defaultBrad King2012-09-211-4/+6
| | | | | The default computation logic is non-trivial. Do not bother with it if the value is already known.
* OS X: Simplify selection of CMAKE_OSX_ARCHITECTURESBrad King2012-09-211-23/+4
| | | | | Incremental changes to the logic over time have led to simply initializing the cache entry with the environment value.
* OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK nameBrad King2012-09-211-2/+35
| | | | | | | | | | Xcode supports SDKROOT values that just name an SDK rather than specifying the full path to it. Recognize these values and handle them. For Xcode we just put the value directly in the generated project file. For Makefile generators we ask xcodebuild to provide the full path to the named SDK. Suggested-by: Jason DiCioccio <jd@ods.org>