summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Teach RunSingleCommand to separate stdout and stderrBrad King2015-04-201-2/+2
| | | | | | | Extend the RunSingleCommand signature to capture stdout and stderr separately. Allow both to be captured to the same std::string to preserve existing behavior. Update all call sites to do this so that this refactoring does not introduce functional changes.
* cmMakefile: Remove always-null first parameter to ReadListFile.Stephen Kelly2015-04-181-12/+12
|
* Port Global property interaction to cmState.Stephen Kelly2015-04-151-7/+8
|
* cmGlobalGenerator: Delegate storage of enabled languages to cmState.Stephen Kelly2015-04-131-11/+4
|
* Merge topic 'introduce-cmState'Brad King2015-04-131-9/+10
|\ | | | | | | | | | | | | | | f081c5bd cmState: Move CacheEntryType enum from cmCacheManager. f71fdf0e cmMakefile: Remove unused CacheManager accessor. ff7169a0 Port to cmState. a6b1ad13 Introduce cmState class.
| * cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-3/+3
| |
| * Port to cmState.Stephen Kelly2015-04-131-6/+7
| |
* | cmGlobalGenerator: Store languages as vector, not map.Stephen Kelly2015-04-121-7/+10
|/ | | | The second component of the map is never used.
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-081-6/+2
| | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.Stephen Kelly2015-04-071-3/+3
| | | | | Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue.
* Revert topic 'refactor-cache-api'Brad King2015-04-071-5/+9
| | | | | | This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic.
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-061-6/+2
| | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.Stephen Kelly2015-04-061-3/+3
| | | | | Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue.
* cmGlobalGenerator: Don't fetch the cache manager in a loop.Stephen Kelly2015-04-051-2/+1
| | | | It doesn't change from Makefile to Makefile.
* Merge topic 'vs-express-build-output'Brad King2015-03-121-4/+13
|\ | | | | | | | | 94887cb6 cmake: Teach --build to get VCExpress output (#15437)
| * cmake: Teach --build to get VCExpress output (#15437)Brad King2015-03-101-4/+13
| | | | | | | | | | | | | | VCExpress does not produce output if its pipes are connected to an interactive terminal. Add a special case to 'cmake --build' to capture the output through a pipe and re-print it instead of sharing output pipes with VCExpress.
* | Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|/
* cmake: Teach --build to honor CMAKE_VERBOSE_MAKEFILE for NinjaGregor Jasny2015-02-261-5/+6
| | | | | | | | | The Ninja build system does not support a in-file verbositiy switch. Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE setting and pass it as an optional '-v' argument to Ninja. This can serve as a reasonable fallback. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* cmGlobalGenerator: Convert set insert algorithm to vector algorithms.Stephen Kelly2015-02-201-9/+17
| | | | Adjust test for new error output.
* cmAlgorithms: Add cmWrap.Stephen Kelly2015-02-201-9/+2
| | | | | | | | | | | | | Port some existing cmJoin to use it. cmJoin is cumbersome to use in cases where the objective is to somehow 'quote' each item and then join it with a separator. In that case, the joiner string is harder to read and reason about. cmWrap aims to solve that. Provide an overload taking char wrappers to simplify the case of surrounding every element in quotes without needing to escape the quote character.
* cmGlobalGenerator: Replace loop with algorithm.Stephen Kelly2015-02-201-9/+4
|
* cmGlobalGenerator: Replace set::insert algorithm with cmRemoveDuplicates.Stephen Kelly2015-02-181-6/+3
|
* Revert "cmGlobalGenerator: Fix value type pushed into autogens vector"Stephen Kelly2015-02-171-1/+1
| | | | | | | This reverts commit ae6fc555a7e8929f6d96545bd1137c8bd378566d. Use the more-natural make_pair algorithm. The compiler motivating the need for this is not supported as a host anymore.
* cmGlobalGenerator: Remove unneeded pointer check.Stephen Kelly2015-02-171-5/+1
| | | | Deleting nullptr is ok.
* Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324)Brad King2015-01-291-19/+0
| | | | | | | | | | | | The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the path to it may change when CMake moves. Avoid storing a specific path to a build program in CMakeCache.txt and instead compute the value for CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value explicitly then honor it. This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for Visual Studio generators.
* Configure some CMake-provided targets with USES_TERMINAL (#14915)Sylvain Joubert2015-01-271-7/+7
| | | | | | | | | | This will make them use the 'console' pool with the Ninja generator. Impacted targets are: - Built-in targets: install, install/local, install/strip, tests, package, package_source, rebuild_cache - Targets provided by the CTestTargets module: Nightly, Continuous, Experimental, and all their variants (*Start, *Configure, ...)
* cmake: Generate an internal 'Labels.json' file next to 'Labels.txt'Brad King2015-01-201-1/+25
| | | | | | | | | In each internal target directory we generate a "Labels.txt" file containing labels for that target and its sources, but it uses an internal format. In order to make the list of labels easier to publish, use a json format and call it "Labels.json". Since we now use jsoncpp headers, link CMakeLib to the jsoncpp library.
* Merge topic 'consistent-empty-method'Brad King2015-01-191-10/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 5f69314e Replace foo.length() pattern with !foo.empty(). fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty() f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty(). 86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty(). fd7b3712 Replace foo.size() pattern with !foo.empty(). aa773035 Replace !foo.size() pattern with foo.empty(). 64592633 cmListCommand: Use empty() and expand whitespace. 607e1938 Replace 'foo.size() != 0' pattern with !foo.empty(). 930bd478 Replace 'foo.size() == 0' pattern with foo.empty(). d92887ef Replace 'foo.size() > 0' pattern with !foo.empty().
| * Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-6/+6
| |
| * Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-3/+3
| |
| * Replace 'foo.size() > 0' pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
| |
* | Use the cmDeleteAll algorithm for types derived from std::map.Stephen Kelly2015-01-171-5/+1
|/
* Use the cmDeleteAll algorithm instead of trivial raw loops.Stephen Kelly2015-01-131-17/+3
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-12/+12
| | | | All compilers hosting CMake support the std class.
* find_library: Fix repeat call after changing directory content (#15293)Brad King2014-12-081-12/+21
| | | | | | | | | | | | | We use cmGlobalGenerator::GetDirectoryContent to avoid repeating directory listings. However, GetDirectoryContent loads content from disk at most once. This breaks find_library calls that occur when disk content has changed since preceding find_library calls. Teach cmGlobalGenerator::GetDirectoryContent to save the directory modification time when content is loaded and re-load content if it changes. Create a RunCMake.find_library test with a case covering this.
* Merge topic 'remove-c_str'Brad King2014-11-251-4/+4
|\ | | | | | | | | 5eb4d759 Remove some unneeded c_str calls.
| * Remove some unneeded c_str calls.Stephen Kelly2014-11-231-4/+4
| |
* | Add an option for explicit BYPRODUCTS of custom commands (#14963)Brad King2014-11-141-2/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common idiom in CMake-based build systems is to have custom commands that generate files not listed explicitly as outputs so that these files do not have to be newer than the inputs. The file modification times of such "byproducts" are updated only when their content changes. Then other build rules can depend on the byproducts explicitly so that their dependents rebuild when the content of the original byproducts really does change. This "undeclared byproduct" approach is necessary for Makefile, VS, and Xcode build tools because if a byproduct were listed as an output of a rule then the rule would always rerun when the input is newer than the byproduct but the byproduct may never be updated. Ninja solves this problem by offering a 'restat' feature to check whether an output was really modified after running a rule and tracking the fact that it is up to date separately from its timestamp. However, Ninja also stats all dependencies up front and will only restat files that are listed as outputs of rules with the 'restat' option enabled. Therefore an undeclared byproduct that does not exist at the start of the build will be considered missing and the build will fail even if other dependencies would cause the byproduct to be available before its dependents build. CMake works around this limitation by adding 'phony' build rules for custom command dependencies in the build tree that do not have any explicit specification of what produces them. This is not optimal because it prevents Ninja from reporting an error when an input to a rule really is missing. A better approach is to allow projects to explicitly specify the byproducts of their custom commands so that no phony rules are needed for them. In order to work with the non-Ninja generators, the byproducts must be known separately from the outputs. Add a new "BYPRODUCTS" option to the add_custom_command and add_custom_target commands to specify byproducts explicitly. Teach the Ninja generator to specify byproducts as outputs of the custom commands. In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets that link, the byproducts must be specified as outputs of the link rule that runs the commands. Activate 'restat' for such rules so that Ninja knows it needs to check the byproducts, but not for link rules that have no byproducts.
* Give the interactive cache editor the USES_TERMINAL propertyPeter Collingbourne2014-11-141-12/+14
|
* Merge topic 'no-cmake-self-install-when-cross-compiling'Brad King2014-11-141-1/+2
|\ | | | | | | | | 15f55cca Do not use just-built CMake to install itself when cross-compiling (#15248)
| * Do not use just-built CMake to install itself when cross-compiling (#15248)Brad King2014-11-131-1/+2
| | | | | | | | | | | | The special case added by commit v2.4.0~3051 (When building CMake itself, use the new cmake to install so that the current cmake can be overwritten, 2004-06-09) does not make sense when cross-compiling.
* | Merge topic 'file-GENERATE-source'Brad King2014-11-131-2/+28
|\ \ | | | | | | | | | | | | | | | b80557c7 file(GENERATE): Evaluate early to allow generating source files 0019d54b Genex: Fix whitespace issue.
| * | file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-121-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The evaluation files must be known before cmTargetTraceDependencies attempts to find them, but we must actually generate the files after cmTargetTraceDependencies, as that can add to target SOURCES. The limitation is that the generated output name must not depend on the SOURCES of a target if the generated file is used by that target. Mark the output files as GENERATED so that trace dependencies does not expect them to already exist in the filesystem. Move the invokation of ForceLinkerLanguage in the Generate logic to after the generated file names are known. ForceLinkerLanguage tries to determine the sources of a target (in order to determine an already-known language) and otherwise fails to get information about the generated file. Test that the output of file(GENERATE) can be used as a target source file and that accessing the target SOURCES in the name of the output file is an error. Accessing the TARGET_OBJECTS would be a similar error if it was legal to use that generator expression in this context. That is not currently possible and is a different error condition, so test the current error output as a reminder to change the expected output if that becomes possible in the future. Test that generated rule files resulting from cmTargetTraceDependencies appear in the SOURCES generated in the output file.
* | | Suppress deprecation warnings for GetVersionExBrad King2014-11-111-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | Visual Studio 12 (2013) deprecated GetVersionEx: warning C4996: 'GetVersionExW': was declared deprecated in favor of either "versionhelpers.h" or VerifyVersionInfo, neither of which exist in some of the older compilers we support. Rather than try to port conditionally to VerifyVersionInfo, simply suppress the warning for now.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-13/+13
| | | | | | | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* | Fix some spelling errors in commentsGeoff Viola2014-10-131-3/+3
|/
* enable_language: Fix error messages on missing modules (#15155)Brad King2014-09-181-6/+6
| | | | | | In cmGlobalGenerator::EnableLanguage, fix error messages for missing module files to actually name the missing module instead of using the empty string returned by GetModulesFile.
* enable_language: Initialize system-specific generator info only onceBrad King2014-09-101-20/+24
| | | | | | Call SetSystemName, SetGeneratorPlatform, and SetGeneratorToolset exactly once after reading CMakeSystem.cmake, and not again on another call to enable_language() or project().
* CMake: Add CMAKE_GENERATOR_PLATFORM optionBrad King2014-09-051-0/+29
| | | | | | | | | | | Reject the option by default. It will be implemented on a per-generator basis. Pass the setting into try_compile project generation. Add cache entry CMAKE_GENERATOR_PLATFORM and associated variable documentation to hold the value persistently. Add a RunCMake.GeneratorPlatform test to cover basic use cases for the option. Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and that it is rejected when the generator does not support a user setting.
* cmGlobalGenerator: Call SetGeneratorToolset even for empty toolsetBrad King2014-09-051-11/+17
| | | | | | Move handling of an empty toolset name into the implementation of the method. This simplifies the VS 10 implementation of default toolset selection because it has one code path that is always called.