summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Automoc: get include dirs without stripping implicit include dirs offAlex Neundorf2012-12-071-11/+16
| | | | | | | | | This should finally fix #13667 and #13762. Instead of adding special handling to guess whether implicit include dirs may have been removed, simply make it possible to query the include dirs without removing the implicit ones. Alex
* Merge topic 'revert-use-generator-target'Brad King2012-11-271-1/+1
|\ | | | | | | | | | | | | 0bbae6f Revert "Move GetLinkInformation to cmGeneratorTarget" d5cf644 Split link information processing into two steps. d8a59ea Port cmGeneratorExpression to cmTarget from cmGeneratorTarget.
| * Revert "Move GetLinkInformation to cmGeneratorTarget"Stephen Kelly2012-11-211-1/+1
| | | | | | | | | | | | | | As we can't move all linking related code from cmTarget, it makes sense to reverse the move in some cases. This reverts commit 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.
* | NMake: Fix problem with empty DEPENDS args (#13392)David Cole2012-11-211-0/+8
|/ | | | | | | | | | | | | add_custom_command can have empty DEPENDS arguments, which was triggering invalid makefile generation for the NMake Makefiles generator. We were mistakenly emitting the build directory appended with "/" plus the empty string... which was then translated to a string ending in \" in build.make... which nmake choked on. The solution is not to emit any dependency when the input DEPENDS is the empty string. Return early from GetRealDependency in this empty input case.
* GenEx: Create cmGeneratorTargets for imported targets.Stephen Kelly2012-10-221-0/+4
| | | | | | | | | | | | | We're going to need to link to them, and all the linking API is moving to cmGeneratorTarget. Skip imported targets when iterating over cmGeneratorTargets in places where we only want targets we build. The GetGeneratorTargets result now includes IMPORTED targets where it didn't before. The GetTargets result, which was what used to be called in these methods does not include IMPORTED targets. This doesn't relate to any known bugs, but in some future uses of GetGeneratorTargets it will be important, so starting the convention and being deliberate now is a good idea.
* Fix config-specific INCLUDE_DIRECTORIES in multi-config generatorsStephen Kelly2012-10-171-2/+3
| | | | | | | | Commit 08cb4fa4 (Process generator expressions in the INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect assumption that CMAKE_BUILD_TYPE was set on the makefile for each generated configuration in multi-config generators. Fix that by making the GetIncludeDirectories API depend on the config.
* Merge topic 'ninja-LIBPATH'Brad King2012-10-021-16/+25
|\ | | | | | | | | | | | | 1e47ccb Ninja: add option to enforce usage of response files e31df03 Ninja: move <OBJECTS> in front of the first linker option 8d674e7 Ninja: move -LIBPATH behind -link option
| * Ninja: move -LIBPATH behind -link optionPeter Kümmel2012-10-011-16/+25
| | | | | | | | Don' pass linker option to the compile
* | Merge topic 'generator-expression-target-properties'Brad King2012-09-281-4/+7
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 083de7e Process generator expressions in the COMPILE_DEFINITIONS target property. 08cb4fa Process generator expressions in the INCLUDE_DIRECTORIES property. 0ef091d Early return if there is no target. eb250cd Add a self-reference check for target properties. 7e80747 Add API to check that dependent target properties form a DAG. 239ac84 Add a generator expression for target properties. e028381 Extend the generator expression language with more logic. b8e61d6 Refactor GetCompileDefinitions a bit. 2c2b25b Return a std::string from GetCompileDefinitions. b7e48e0 Add an AppendDefines std::string overload. 9a16087 Convert paths in INCLUDE_DIRECTORIES property to Unix slashes. 4557c8d Don't prepend a path before generator expressions in include_directories. c6abc41 Add include guard for cmGeneratorExpression. 0ff4e3f Port remaining code to GetCompileDefinitions(). f178d53 Fix indentation in the code blocks generator.
| * Early return if there is no target.Stephen Kelly2012-09-281-4/+7
| | | | | | | | | | | | The remainder of this method depends on the target existing (otherwise the includes container would be empty), so make the code a little more readable.
* | Merge topic 'use-generator-target'David Cole2012-09-251-31/+32
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 879fd35 Revert "Move GenerateTargetManifest to cmGeneratorTarget." 6674583 Fix compiler warning with initialization order. 5285458 Add convenience for getting a cmGeneratorTarget to use. c31f3d9 Add a wrapper for accessing config-specific compile-definitions. d1446ca Append the COMPILE_DEFINITIONS from the Makefile to all targets. 290e92a Move GetIncludeDirectories to cmGeneratorTarget. f9146f6 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget. 9facfd1 Move GetCreateRuleVariable to cmGeneratorTarget. 78bfee3 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget. 4f5384e Move GetLinkInformation to cmGeneratorTarget 987e12e Move GenerateTargetManifest to cmGeneratorTarget. 14bf778 Store cmGeneratorTargets with the makefile. f428ca2 Add more forwarding API to cmGeneratorTarget.
| * Revert "Move GenerateTargetManifest to cmGeneratorTarget."Stephen Kelly2012-09-201-4/+3
| | | | | | | | | | | | | | | | This reverts commit 987e12e2f962b6e9ed9f15f8ff486512911b744e. GenerateTargetManifest is called by the global generator before it creates the generator targets, so we can't move it to cmGeneratorTarget yet.
| * Move GetIncludeDirectories to cmGeneratorTarget.Stephen Kelly2012-09-191-2/+2
| |
| * Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.Stephen Kelly2012-09-191-20/+19
| |
| * Move GetCreateRuleVariable to cmGeneratorTarget.Stephen Kelly2012-09-191-1/+1
| |
| * Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.Stephen Kelly2012-09-191-16/+17
| |
| * Move GetLinkInformation to cmGeneratorTargetStephen Kelly2012-09-191-2/+3
| |
| * Move GenerateTargetManifest to cmGeneratorTarget.Stephen Kelly2012-09-191-3/+4
| |
* | OS X: Always generate -isysroot if any SDK is in useBrad King2012-09-211-29/+17
|/ | | | | | | | 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.
* Don't duplicate -D defines sent to the compiler.Stephen Kelly2012-08-201-29/+32
| | | | | | | | | | | There is no need to do so. Be consistent with include directories and ensure uniqueness. This requires changing the API of the cmLocalGenerator::AppendDefines method, and changing the generators to match. The test unfortunately can't test for uniqueness, but it at least verifies that nothing gets lost.
* Merge topic 'no-source-language-crash'David Cole2012-06-211-4/+7
|\ | | | | | | | | 2c2fbaf Do not crash on unknown source language (#13323)
| * Do not crash on unknown source language (#13323)Mariusz Plucinski2012-06-201-4/+7
| | | | | | | | | | | | If a source file extension is not recognized as any language then src.GetLanguage() may return NULL. Check the result before dereferencing in cmLocalGenerator::GetObjectFileNameWithoutTarget.
* | Merge topic 'ninja-cldeps'David Cole2012-06-191-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eb410e8 Ninja: disable cldeps for bcc32, it's too old, and ninja would also not build 5ead31d Ninja: try work around for bcc32 bug 1333b57 Ninja: build server fixes 9081e3a remove warning about unused parameter f430bea Ninja: maybe this fixes the bcc32 build f2c1288 Ninja: msvc6 for-scoping 44b9bbc Ninja: build with old msvc versions 57156a5 Ninja: build server fixes f1abdce Ninja: some bytes of the rc files couldn't be piped correctly 2de963d Ninja: don't remove space between command and parameters 50b6f33 Ninja: build cmcldeps with mingw c05653e Ninja: try to make GetProcessId visible ab245ff Ninja: but cl supports /nologo ... bf58e9a Ninja: no /nologo option in old rc.exe 2fb07fc Ninja: Eclipse and KDevelop fixes for ninja 518c065 Ninja: don't pollute build dir with preprocessed rc files ...
| * | Ninja: work with ninja/master, don't compile rc files with clPeter Kuemmel2012-06-121-0/+7
| | | | | | | | | | | | | | | Ninja generates for paths with spaces wrong results for $out.d, using the new DEP_FILE variable instead.
* | | Refactor generation of shared library flagsStephen Kelly2012-06-121-6/+105
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a variety of purposes that are correlated with shared libraries but not exclusive to them. Refactor generation of these flags to use new purpose-specific platform variables CMAKE_<lang>_COMPILE_OPTIONS_DLL CMAKE_<lang>_COMPILE_OPTIONS_PIC CMAKE_<lang>_COMPILE_OPTIONS_PIE Activate the DLL flags specifically for shared libraries. Add a new POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and default to true for shared libraries to preserve default behavior. Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to allow easy global configuration in projects. Although the default behavior is unchanged by this refactoring, the new approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely. We must leave it set in case projects reference the value. Furthermore, if a project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new value to be used. Add policy CMP0018 to handle compatibility with projects that modify this platform variable. Add a PositionIndependentCode test on platforms where we can get meaningful results.
* | 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.