summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* OS X: Improve default CMAKE_OSX_SYSROOT selectionBrad King2012-09-211-44/+39
| | | | | | | Simplify the search for OSX_DEVELOPER_ROOT and allow it to fail if no "/Developer" exists. When it does exist, always find a MacOSX SDK inside it to use as the default CMAKE_OSX_SYSROOT. Otherwise set CMAKE_OSX_SYSROOT to empty.
* OS X: Always generate -isysroot if any SDK is in useBrad King2012-09-214-7/+8
| | | | | | | | Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT. Replace internal platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general CMAKE_${lang}_SYSROOT_FLAG variable. If the -isysroot flag exists and CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to compiler command lines. This is already done in the Xcode IDE.
* Merge topic 'vs-link-rsp'Brad King2012-09-192-5/+11
|\ | | | | | | | | 5598d9b Ninja: don't expand any rsp files
| * Ninja: don't expand any rsp filesPeter Kuemmel2012-09-192-5/+11
| |
* | OS X: Add platform-specific Clang compiler info files (#13536)Brad King2012-09-173-0/+30
|/ | | | | | | | | | | Clang has the same interface as GNU except that we do not need to test for the deployment target and sysroot flags. Simply set variables CMAKE_${lang}_HAS_ISYSROOT CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG to true because every version of Clang available on OS X supports these flags.
* Add WindowsCE platform information filesPatrick Gansterer2012-09-055-9/+49
| | | | | | | This enables CMake to create Makefiles targeting Windows CE devices. CMake needs to be run within a cross compile command prompt and requires a toolchain file which sets CMAKE_SYSTEM_NAME to "WindowsCE" and optionally CMAKE_SYSTEM_VERSION.
* Merge topic 'msvc-compiler-info'Brad King2012-08-311-2/+2
|\ | | | | | | | | 16fa7b7 VS: Fix MSVC_IDE definition recently broken by refactoring
| * VS: Fix MSVC_IDE definition recently broken by refactoringBrad King2012-08-301-2/+2
| | | | | | | | | | | | In commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23) we accidentally flipped the 0/1 values of MSVC_IDE. Flip them back and teach the CheckCompilerRelatedVariables test to check the variable.
* | Merge topic 'mingw-unix-generator'Brad King2012-08-301-0/+4
|\ \ | |/ |/| | | | | be9afbf Find mingw's windres also when Unix Makefiles are used
| * Find mingw's windres also when Unix Makefiles are usedPeter Kümmel2012-08-271-0/+4
| |
* | Merge branch 'cmake-platform-info-version' into msvc-compiler-infoBrad King2012-08-301-3/+3
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: Modules/CMakeTestCCompiler.cmake Modules/CMakeTestCXXCompiler.cmake Modules/Platform/Windows-cl.cmake
| * | Make platform information files specific to the CMake versionBrad King2012-08-242-9/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
* | Modernize MSVC compiler information filesBrad King2012-08-304-99/+81
| | | | | | | | | | | | | | Remove the old-style "Windows-cl.cmake" and its helper "cl.cmake". Load the information through new-style "Platform/Windows-MSVC-<lang>.cmake" files. Factor information common to C and CXX into a helper file "Platform/Windows-MSVC.cmake" loaded from the per-language files.
* | VS: Simplify MSVC version reportingBrad King2012-08-302-98/+42
| | | | | | | | | | | | | | | | | | Teach Windows-cl.cmake to use CMAKE_(C|CXX)_COMPILER_VERSION to set the "MSVC##" and MSVC_VERSION variables. It no longer needs the IDE generator to dictate the version or to detect the version by running the command-line tool for NMake and Ninja generators. Drop configuration of CMakeCPlatform.cmake and CMakeCXXPlatform.cmake from Windows-cl.cmake.in because all the results it saved are now cheap to compute every time.
* | VS: Remove support for "free" version 2003 toolsBrad King2012-08-232-57/+11
|/ | | | | | | Several more recent Visual Studio Express editions are now available and they support debug builds. Simplify our VS platform files by removing support for these old tools. If anyone still uses them we can restore support with a more modern way to test for them.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-1329-149/+149
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-1373-1288/+1288
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-1316-36/+36
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Merge topic 'watcom-compiler-version'Brad King2012-08-131-37/+24
|\ | | | | | | af42ae4 Watcom: Simplify compiler version detection (#11866)
| * Watcom: Simplify compiler version detection (#11866)Brad King2012-08-131-37/+24
| | | | | | | | | | | | | | | | Since commit c198730b (Detect Watcom compiler version with its id, 2011-12-07) the CMAKE_(C|CXX)_COMPILER_VERSION variables are set for the Watcom compiler. Use these in Windows-wcl386.cmake to set the old WATCOM1* version variables. This avoids using the old EXECUTE_PROCESS command which failed due to extra quotes anyway.
* | Prefer generic system compilers by default for C, C++, and FortranBrad King2012-08-024-0/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach CMake to prefer the system default compiler automatically when no compiler is specified. By default use "cc" for C, "CC" for C++, and "f95" for Fortran. Load a new Platform/<os>-<lang>.cmake module to allow each platform to specify for each language its system compiler name(s) and/or exclude certain names. Create Platform/(CYGWIN|Darwin|Linux|Windows)-CXX.cmake modules to specify "c++" as the system C++ compiler name for these platforms. On systems that use case-insensitive filesystems exclude C++ compiler names that are distinguished from C compiler names only by case. This will change the default compiler selection for existing build scripts that do not specify a compiler when run on machines with separate system and GNU compilers both installed in the PATH. We do not make this change in default behavior lightly. However: (1) If a given build really needs specific compilers one should specify them explicitly e.g. by setting CC, CXX, and FC in the environment. (2) The motivating case is to prefer the system Clang on newer OS X systems over the older GNU compilers typically also installed. On such systems the names "cc" and "c++" link to Clang. This is the first platform known to CMake on which "c++" is not a GNU compiler. The old behavior selected "gcc" for C and "c++" C++ and therefore chooses GNU for C and Clang for C++ by default. The new behavior selects GNU or Clang consistently for both languages on older or newer OS X systems, respectively. (3) Other than the motivating OS X case the conditions under which the behavior changes do not tend to exist in default OS installations. They typically occur only on non-GNU systems with manually-installed GNU compilers. (4) The consequences of the new behavior are not dire. At worst the project fails to compile with the system compiler when it previously worked with the non-system GNU compiler. Such failure is easy to work around (see #1). In short this change creates a more sensible default behavior everywhere and fixes poor default behavior on a widely-used platform at the cost of a modest change in behavior in less-common conditions.
* Merge topic 'ninja-rspfile-link-libraries'David Cole2012-07-121-1/+3
|\ | | | | | | | | | | | | | | | | | | 4bb94c9 Ninja: sysconf() is declared in unistd.h bb36759 Ninja: enable response file support on Mac (length 262144) 3a2c8e8 Ninja: disable work around when linking with mingw 3856e66 Ninja: error on missing rspfile_content 8c1e35c Ninja: remove some unused default arguments 7f647cf Ninja: also write link libraries to rsp file
| * Ninja: disable work around when linking with mingwPeter Kümmel2012-07-111-1/+3
| | | | | | | | | | | | | | The work around is only needed by older GCCs (only testet 4.4/4.7) Ninja is very new so chances are high that there is also a new mingw. Use slashes in link rsp file, because ar.exe can't handle \.
* | Merge topic 'aix-gnu-asm'David Cole2012-07-121-0/+2
|\ \ | | | | | | | | | | | | 7755283 Add ASM platform information for GNU compiler on AIX (#13390)
| * | Add ASM platform information for GNU compiler on AIX (#13390)Brad King2012-07-101-0/+2
| |/ | | | | | | | | | | | | Among other flags this sets RPATH flags correctly so that CMake knows how to treat CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH for the ASM language. This is the GNU compiler equivalent to commit a0bab7ae (Add ASM platform information for XL compiler on AIX, 2011-03-02), made for XL.
* | AIX-GNU: Link shared libs with -brtl,-bnoipath (#13352)Brad King2012-07-091-1/+2
|/ | | | We already use these flags with the XL toolchain. Use them for GNU too.