summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: apply CMAKE_<LANG>_FLAGS_<TYPE> to executable targets (#13069)Peter Collingbourne2012-05-161-4/+1
| | | | Based on a patch by Zaheer Chothia!
* Support building shared libraries or modules without soname (#13155)Modestas Vainius2012-04-301-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a boolean target property NO_SONAME which may be used to disable soname for the specified shared library or module even if the platform supports it. This property should be useful for private shared libraries or various plugins which live in private directories and have not been designed to be found or loaded globally. Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and hard-coded -install_name flags with a conditional <SONAME_FLAG> which is expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG definition as long as soname supports is enabled for the target in question. Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in rules in case third party projects still use it. Such projects would not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be expanded. Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well. Since -install_name is soname on OS X, this should not be a problem if this variable is expanded only if soname is enabled. The Ninja generator performs rule variable substitution only once globally per rule to put its own placeholders. Final substitution is performed by ninja at build time. Therefore we cannot conditionally replace the soname placeholders on a per-target basis. Rather than omitting $SONAME from rules.ninja, simply do not write its contents for targets which have NO_SONAME. Since 3 variables are affected by NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if soname is enabled.
* Merge branch 'object-library' into ninja-object-libraryBrad King2012-03-161-24/+6
|\
| * Add OBJECT_LIBRARY target typeBrad King2012-03-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This library type can compile sources to object files but does not link or archive them. It will be useful to reference from executable and normal library targets for direct inclusion of object files in them. Diagnose and reject the following as errors: * An OBJECT library may not be referenced in target_link_libraries. * An OBJECT library may contain only compiling sources and supporting headers and custom commands. Other source types that are not normally ignored are not allowed. * An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands. * An OBJECT library may not be installed, exported, or imported. Some of these cases may be supported in the future but are not for now. Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
| * Merge branch 'cleanup-object-file-names' into object-libraryBrad King2012-03-091-11/+0
| |\
| | * Remove unused partial OBJECT_FILES property implementationBrad King2012-03-061-11/+0
| | | | | | | | | | | | | | | | | | | | | Remove partial implementation added by commit ca0230a3 (check in initial conv library stuff, 2007-02-16) since it was never finished. It does not make sense for multi-configuration generators since no specific build configuration is processed at CMake time.
| * | Merge topic 'target-include-directories'David Cole2012-03-081-26/+26
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d662dff Fix shadowed variable warning on dashboard results f66e735 Fix compiler warning reported on older Borland dashboard. d90eed4 Fix compiler error reported on older Borland dashboard. 8233636 Update the documentation regarding INCLUDE_DIRECTORIES. d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES c21db87 Make search paths ordered and unique 22021f0 Remove cmMakefile::GetIncludeDirectories 9106b56 Extract and use the INCLUDE_DIRECTORIES target properties. 840509b Keep the INCLUDE_DIRECTORIES target property up to date. a4d5f7b Add API to get the ordered includes for a target. 8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories 7620932 Remove include flags memoization. 97a5faa Make it safe to call this method without creating duplicates. edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
| * \ \ Merge topic 'factor-install-type'David Cole2012-03-021-4/+0
| |\ \ \ | | | |/ | | |/| | | | | | | | | 573fa3b Factor cmInstallType out of cmTarget::TargetType
| | * | Factor cmInstallType out of cmTarget::TargetTypeBrad King2012-02-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | The purpose of the TargetType enumeration was overloaded for install type because install rules were once recorded as targets. Factor the install types out into their own enumeration.
| * | | Drop if(...) check because condition is always trueYury G. Kudryashov2012-02-271-9/+2
| |/ / | | | | | | | | | GetLocation returns std::string::c_str() which is never NULL
* | | Ninja: add .def file supportPeter Kuemmel2012-03-071-1/+1
| | |
* | | Merge branch 'target-include-directories' into ninja-generatorDavid Cole2012-02-221-26/+26
|\ \ \ | | |/ | |/|
| * | Extract and use the INCLUDE_DIRECTORIES target properties.Stephen Kelly2012-02-221-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate callers of cmMakefile::GetIncludeDirectories. All callers of GetIncludeDirectories should go through the local generator object. Only the local generator calls cmTarget::GetIncludeDirectories directly.
| * | CMake: Eliminate cmMakefile::IncludeDirectoriesDavid Cole2012-02-221-3/+3
| | | | | | | | | | | | Instead, re-implement it in terms of the directory property INCLUDE_DIRECTORIES.
| * | Remove include flags memoization.Stephen Kelly2012-02-221-13/+2
| | |
| * | Make it safe to call this method without creating duplicates.Stephen Kelly2012-02-221-2/+6
| | |
| * | Refactor GetIncludeFlags to take includes instead of fetching themStephen Kelly2012-02-221-6/+9
| |/
* | Add executable with exports flag support to cmLocalGenerator::GetTargetFlagsPeter Collingbourne2012-02-021-0/+10
|/
* Remove trailing whitespace from cmLocalGeneratorBrad King2011-11-291-73/+73
|
* Fix configuration-dependent flag lookup in cmLocalGenerator::GetTargetFlagsPeter Collingbourne2011-10-021-5/+22
| | | | | | | Specifically, perform configuration-dependent lookup of STATIC_LIBRARY_FLAGS for static libraries, and use the correct prefix for configuration-dependent lookup of LINK_FLAGS (i.e. "LINK_FLAGS_", as opposed to the value of the LINK_FLAGS property).
* Introduce a cmLocalGenerator::ConvertToIncludeReference functionPeter Collingbourne2011-10-021-1/+8
| | | | | This provides a mechanism for the local generator to override how header search paths are generated.
* Refactor TargetTypeNames.Nicolas Despres2011-10-021-1/+1
| | | | | | Make it a static method instead of an array. It is safer for the type checking and if we add a new target type we will be warned to add a case to the switch.
* Fortran: Add support for free- and fixed-form flagsBrad King2011-08-311-0/+25
| | | | | | | Define a "Fortran_FORMAT" target and source file property. Initialize the target property from a "CMAKE_Fortran_FORMAT" variable. Interpret values "FIXED" and "FREE" to indicate the source file format. Append corresponding flags to the compiler command line.
* Merge topic 'custom-command-slashes'Brad King2011-03-311-1/+0
|\ | | | | | | | | 1286050 Normalize slashes of add_custom_(command|target) DEPENDS (#11973)
| * Normalize slashes of add_custom_(command|target) DEPENDS (#11973)Brad King2011-03-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All commands accepting file paths should normalize the slashes so that the string-represented names can be compared reliably. The commands add_library and add_executable have done this for years. We taught add_custom_command to normalize its OUTPUT names in commit a75a0a14 (Normalize add_custom_command OUTPUT names, 2010-12-15). We handled a special case of the DEPENDS option in commit 7befc007 (Handle trailing slashes on add_custom_command DEPENDS, 2011-01-26). Teach both add_custom_command and add_custom_target to normalize slashes of DEPENDS files up front. This approach subsumes the above-mentioned special case so remove the one line added for it but keep its test. Extend the CustomCommand test to check that slash count mismatches between custom command OUTPUT and DEPENDS can still be linked correctly.
* | Merge topic 'include-flags-response-file'Brad King2011-03-221-10/+21
|\ \ | |/ |/| | | | | | | | | | | 86cb17b Pass include directories with response files to GNU on Windows 9a0b9bc Optionally pass include directories with response files 6e8a67f Generate target-wide flags before individual build rules d099546 Factor old-style -D flags out from -I flag generation
| * Optionally pass include directories with response filesBrad King2011-03-171-8/+20
| | | | | | | | | | | | Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to enable use of response files for passing the list of include directories to compiler command lines.
| * Factor old-style -D flags out from -I flag generationBrad King2011-03-151-2/+1
| | | | | | | | | | | | Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to all call sites so that the method exclusively constructs a string of include search path flags.
* | Handle trailing slashes on add_custom_command DEPENDSBrad King2011-01-261-0/+1
|/
* Remove cmLocalGenerator::GetRealLocationBrad King2010-12-081-18/+0
| | | | | | The cmCustomCommandGenerator::GetCommand method completely replaces the purpose of this method. Re-implement GetRealLocation inline at the only remaining call site and remove it.
* Skip file-level dependencies on custom targets (#11332)Brad King2010-12-081-4/+3
| | | | | | | A custom command may name a target created by add_custom_target in its DEPENDS field. Treat this case as a target-level dependency only since a custom target provides no standard file on which to add a file-level dependency.
* Improve signature of cmLocalGenerator::GetRealDependencyBrad King2010-12-081-12/+17
| | | | Allow file-level custom command dependencies to be skipped.
* No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)Brad King2010-09-081-33/+5
| | | | | | Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE into cmMakefile::GetConfigurations. Read the former only in multi-config generators.
* Remove cmSystemTools::EscapeSpaces methodBrad King2010-08-181-6/+18
| | | | | | The last remaining call to this method exists only for compatibility. Remove the method and put its implementation inline in place of the last call.
* Fix spelling errors reported by Lintian.Kai Wasserbäch2010-07-131-1/+1
| | | | | During a Lintian run on the binary packages of CMake in Debian I was notified of many spelling mistakes.
* Merge branch 'mingw-response-files'Brad King2010-06-151-0/+4
|\
| * Use forward slashes for objects in response filesBrad King2010-03-111-0/+4
| | | | | | | | | | | | | | | | | | | | Response files are parsed by tools, not by shells. We teach cmLocalGenerator::Convert() a new "RESPONSE" output format and use it for objects listed in response files. It does not do special slash or MSYS root translation like the "SHELL" format does. This is necessary for GNU tools on Windows to understand response file content. See issue #10401.
* | -improve crosscompiling from Linux to iphone (#10526)Alex Neundorf2010-05-011-7/+9
|/ | | | | | Patch by Karol Krizka Alex
* Fix line length style issue.David Cole2010-02-021-1/+2
|
* Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should ↵David Cole2010-01-291-3/+7
| | | | always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running.
* Singly-quote target names for Watcom linkerBrad King2009-11-301-0/+10
| | | | | | | 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.
* Define per-target OSX_ARCHITECTURES propertyBrad King2009-10-211-25/+26
| | | | | | | | | | | The CMAKE_OSX_ARCHITECTURES variable works only as a global setting. This commit defines target properties OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> to specify OS X architectures on a per-target and per-configuration basis. See issue #8725.
* Split Borland compiler information filesBrad King2009-10-081-9/+0
| | | | | | | | | | | 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.
* Introduce "build feature" lookup frameworkBrad King2009-10-021-0/+20
| | | | | | | This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to query "build feature" properties. These methods handle local-to-global scope and per-configuration property lookup. Specific build features will be defined later.
* Fix default install prefix on HaikuBrad King2009-09-301-0/+17
| | | | | | | | 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.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling ↵David Cole2009-09-251-3/+8
| | | | GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location...
* Optionally force conversion to relative pathBrad King2009-09-221-13/+16
| | | | | | | | In cmLocalGenerator::ConvertToRelativePath we normally convert to relative path only if the local and remote paths both lie inside the source tree or both lie inside the build tree. This commit adds an optional 'force' argument to allow conversion even when this rule is violated.
* Fix check for -isysroot on OS XBrad King2009-09-191-7/+2
| | | | | | | | | | | 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.
* Only do the OSX arch stuff on OSX.Bill Hoffman2009-09-181-2/+3
|