summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fix-C-standard-features'Brad King2015-02-051-8/+22
|\ | | | | | | | | | | | | | | | | fb3487a9 Features: Fix C90 feature detection. 6027798a Features: Allow setting standard dialect below the default. 9d767810 Features: Populate CMAKE_<LANG>_STANDARD_DEFAULT only for supported compilers. 72537e44 Features: Add dialect compile flags only if default is known. 82c9d686 AppleClang: Remove redundant UNIX condition.
| * Features: Allow setting standard dialect below the default.Stephen Kelly2015-02-041-1/+15
| | | | | | | | | | If the requested standard dialect is older than the default dialect then we must use a flag because we cannot decay to a newer standard.
| * Features: Add dialect compile flags only if default is known.Stephen Kelly2015-02-041-9/+9
| | | | | | | | | | | | | | | | | | The CMAKE_<LANG>_STANDARD_DEFAULT variable indicates whether the compiler has any notion of standard levels and that CMake knows about them. If no language standard levels are available, skip all logic to attempt to add a flag for the level. Also fail with an internal error if a bad default value is set.
* | Merge topic 'fix-default-install-config'Brad King2015-02-041-9/+5
|\ \ | |/ |/| | | | | dea42d92 install: Fix regression in default configuration selection
| * install: Fix regression in default configuration selectionBen Boeckel2015-02-031-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | The refactoring in commit v3.1.0-rc1~812^2~16 (stringapi: Pass configuration names as strings, 2014-02-09) broke the code path in cmLocalGenerator::GenerateInstallRules that intends to pick a default install configuration for multi-config generators. Fix the logic to select an empty default configuration only when using a single-config generator whose CMAKE_BUILD_TYPE is not set. Inspired-by: Roman Wüger <roman.wueger@gmx.at> Reported-by: NoRulez <norulez@me.com>
* | Features: Define meaning for no language standard defaultBrad King2015-01-291-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the <LANG>_STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case.
* | Replace foo.length() pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
| |
* | Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-4/+4
| |
* | Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
| |
* | Replace 'foo.size() > 0' pattern with !foo.empty().Stephen Kelly2015-01-181-3/+3
| |
* | Merge topic 'drop-ancient-workarounds'Brad King2015-01-121-15/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler.
| * | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-15/+15
| | | | | | | | | | | | All compilers hosting CMake support the std class.
* | | Use insert instead of a loop in some cases.Stephen Kelly2015-01-111-10/+2
|/ / | | | | | | | | | | Limit this change to inserting into a vector from a vector. A follow up change can use insert for inserting into a set.
* | file: Add LOCK subcommand to do file and directory lockingRuslan Baratov2014-12-031-0/+6
| | | | | | | | | | | | | | | | | | Provide options to fail without blocking or to block up to a timeout. Provide options to specify the scope containing the lock so it can be released automatically at the end of a function, file, or process. Extend the RunCMake.file test with cases covering the file(LOCK) command usage and error cases.
* | file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-19/+19
|/ | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Ninja: Fix RC include directories regressionBrad King2014-10-131-3/+6
| | | | | | | | | | | | | | | | | Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags output formatting, 2014-03-04) caused Windows Resource Compiler include directories to be computed as relative paths in the Ninja generator. This breaks the cmcldeps handling of include paths. The reason for the regression is that several cmLocalGenerator::GetIncludeFlags callers treated the fourth "bool forResponseFile" argument as if it controlled whether include directories were a full path. It actually did control that by accident until the above commit. Add an explicit "bool forceFullPaths" argument to GetIncludeFlags and thread the value through ConvertToIncludeReference as needed. Update GetIncludeFlags call sites that really wanted to control the forResponseFile setting to be aware of the new argument. Extend the VSResource test to cover this case.
* cmLocalGenerator: Fix AddBuildTargetRule object file path conversionBrad King2014-07-221-1/+1
| | | | The object file list is constructed for a shell, not a Makefile rule.
* cmLocalGenerator: Rename 'MAKEFILE' to 'MAKERULE'Brad King2014-07-221-2/+2
| | | | | Rename the internal enumeration value for converting paths destined for use in Makefile rule syntax.
* Merge topic 'install-messages'Brad King2014-06-271-4/+19
|\ | | | | | | | | | | | | | | | | | | | | | | d19b64d6 install(DIRECTORY): Add MESSAGE_NEVER option to avoid output (#13761) c9568de5 install: Add CMAKE_INSTALL_MESSAGE variable (#13761) ec7cf7ea install: Thread message level setting through internal API abebcd23 file(INSTALL): Add undocumented options to control output verbosity 464567a5 file(INSTALL): Report existing DIRECTORY as Up-to-date f701b0b7 file(INSTALL): Do not pre-create DESTINATION for DIRECTORY f0a01962 cmInstallTargetGenerator: Drop default constructor arguments 67815894 Help: Add install() command document section headers
| * install: Add CMAKE_INSTALL_MESSAGE variable (#13761)Brad King2014-06-241-1/+1
| | | | | | | | | | | | | | | | | | Create a variable to allow users to control which installation messages are printed. In particular, provide a "LAZY" setting that prints "Installing" messages but not "Up-to-date" messages. This is desirable for incremental re-installations. Suggested-by: J Decker <d3ck0r@gmail.com>
| * install: Thread message level setting through internal APIBrad King2014-06-241-0/+1
| | | | | | | | | | | | | | Create a cmInstallGenerator::MessageLevel enumeration for future use in specifying install message verbosity. Thread values of the type through constructors and save the value as a member of cmInstallGenerator. Use only a "MessageDefault" value for now.
| * cmInstallTargetGenerator: Drop default constructor argumentsBrad King2014-06-241-4/+18
| | | | | | | | | | | | They are used only in cmLocalGenerator::GenerateTargetInstallRules. Move the defaults to a local helper where the context justifies their values.
* | Fix some generator crashes on undefined CMAKE_BUILD_TYPEBrad King2014-06-231-1/+1
|/ | | | | | | | | | Since commit 84fdc9921 (stringapi: Pass configuration names as strings, 2014-02-09), it is not safe to use GetDefinition("CMAKE_BUILD_TYPE") without checking the return value. Use GetSafeDefinition instead so that a missing definition is treated as an empty string like code paths did prior to the above commit. Reported-by: Richard Wirth <richard@califax.de>
* Features: Escape the COMPILE_OPTIONS for dialects.Stephen Kelly2014-06-131-2/+5
| | | | | Allow for future handling as a list, not a string which may contain whitespace.
* Add OBJECT_FILE_DIR rule placeholder for compilation linesBrad King2014-06-051-0/+7
| | | | | | | | | Some compilers do not offer an option to specify the path to the object file, but rather only to the directory in which to place the object file. See issue 14876 for some examples. Add a new OBJECT_FILE_DIR placeholder to specify the directory containing the object file for the current compilation. This may differ from the main target OBJECT_DIR when the object corresponds to a source in a subdirectory.
* Features: Enable compiler extensions by default.Stephen Kelly2014-05-311-2/+10
| | | | | | | | | | | Compilers enable their extensions by default, and disabling them implicitly can lead to results which are surprising or non-obvious to debug. http://public.kitware.com/pipermail/cmake-developers/2014-May/010575.html http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10214 https://www.mail-archive.com/cmake-developers@cmake.org/msg10116.html (Compiler feature extensions by default, 29 May 2014)
* Features: Add support for C++14 features.Stephen Kelly2014-05-221-0/+1
| | | | Record the features implemented by GNU 4.9 and Clang 3.4.
* Merge topic 'ninja-intel-ipo'Brad King2014-05-221-5/+3
|\ | | | | | | | | | | | | b6e2e0d1 Ninja: Fix Intel interprocedural optimization with static libraries 5d12b87b cmGeneratorTarget: Improve GetCreateRuleVariable API c2eeb08b cmTarget: Add GetFeatureAsBool method
| * cmGeneratorTarget: Improve GetCreateRuleVariable APIBrad King2014-05-211-5/+3
| | | | | | | | | | Pass the language and configuration to the method so it can return the complete rule variable name.
* | Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-211-0/+25
|/ | | | | | | | | | | | Allow setting build properties based on the features available for a target. The availability of features is determined at generate-time by evaluating the link implementation. Ensure that the <LANG>_STANDARD determined while evaluating COMPILE_FEATURES in the link implementation is not lower than that provided by the INTERFACE of the link implementation. This is similar to handling of transitive properties such as POSITION_INDEPENDENT_CODE.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-0/+4
| | | | | | | | | | | Add properties and variables corresponding to CXX equivalents. Add features for c_function_prototypes (C90), c_restrict (C99), c_variadic_macros (C99) and c_static_assert (C11). This feature set can be extended later. Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader to conditionally represent the c_restrict feature.
* Merge topic 'decay-language-version'Brad King2014-05-081-6/+60
|\ | | | | | | | | | | | | | | | | | | | | 205215fb cmTarget: Add CXX_STANDARD_REQUIRED to control decay. 1df2116b Features: Decay language flag if requested is not available. c4f4dac2 Project: Fix exit-on-error with compile feature tests. 5bb7ce72 Project: Use nullary form of main for compile feature tests. 64254e7a Project: Remove extern from static string in feature tests. 0d9c99bf Help: Fix order of help entries. dc7639bd Tests: Fix name of cache variable.
| * cmTarget: Add CXX_STANDARD_REQUIRED to control decay.Stephen Kelly2014-05-071-0/+20
| |
| * Features: Decay language flag if requested is not available.Stephen Kelly2014-05-071-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the highest standard compile flags available if requested language version is too new. This supports use-cases like set(CMAKE_CXX_STANDARD 14) # Compiled with -std=c++11 with GNU 4.7, which has no -std=c++14 # or equivalent flag add_executable(main main.cpp) This can be used in combination with preprocessor defines which communicate the availability of certain language features for optional use.
* | Merge topic 'dev/refactor-source-depends-in-ninja'Brad King2014-05-071-5/+14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 2583eff6 ninja: Factor out custom command order-only depends 18e478a8 ninja: Factor out target-level order-only dependencies 6fa6bedf LocalGenerator: Add a string overload for AppendFlags 01b79c63 ninja: Don't use a stringstream to build an argument list 3c640891 ninja: Use string parameters
| * | LocalGenerator: Add a string overload for AppendFlagsBen Boeckel2014-05-071-5/+14
| |/
* | OS X: Use -iframework for system framework directoriesMikołaj Siedlarek2014-05-071-3/+17
|/ | | | | | | Just like -I flag has its -isystem counterpart which marks an include directory as a system directory and prevents unwanted warnings, on Apple systems there is -iframework -- a system directory replacement for -F. Use this flag to implement include_directories(SYSTEM) for frameworks.
* Merge topic 'target_compile_features'Brad King2014-04-151-0/+39
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9eaf3755 Export: Populate INTERFACE_COMPILE_FEATURES property. 8ed59fc2 Add target_compile_features command. 4e6ca504 cmTargetPropCommandBase: Change the interface to return bool. 5412dede cmTarget: Transitively evaluate compiler features. baff4434 cmTarget: Allow populating COMPILE_FEATURES using generator expressions. f97bf437 Features: Add cxx_auto_type. 03355d6b cmTarget: Add COMPILE_FEATURES target property. faeddf64 project: Add infrastructure for recording CXX compiler features 913394af cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties. 8238a6cd Add some COMPILE_OPTIONS for specifying C++ dialect. 892243fc Tests: Require CMake 3.0 for the SystemInformation test. 59b5fdd3 Don't load Clang-CXX from AppleClang-CXX.
| * cmTarget: Transitively evaluate compiler features.Stephen Kelly2014-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Extend the interface of the target_compile_features command with PUBLIC and INTERFACE keywords. Populate the INTERFACE_COMPILER_FEATURES target property if they are set. Consume the INTERFACE_COMPILER_FEATURES target property from linked dependent targets to determine the final required compiler features and the compile flag, if needed. Use the same pattern of origin-debugging which is used for other build properties.
| * cmTarget: Allow populating COMPILE_FEATURES using generator expressions.Stephen Kelly2014-04-071-9/+6
| | | | | | | | | | | | Delay validation of the content as a feature if it contains a generator expression. It will be checked again at generate-time after evaluation.
| * cmTarget: Add COMPILE_FEATURES target property.Stephen Kelly2014-04-071-0/+13
| | | | | | | | | | | | | | Use the contents of it to upgrade the CXX_STANDARD target property, if appropriate. This will have the effect of adding the -std=c++11 compile flag or other language specification on GNU when that is needed for the feature.
| * cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties.Stephen Kelly2014-04-071-0/+29
| | | | | | | | | | These are used to determine whether to add -std=c++11, -std=gnu++11 etc flags on the compile line.
* | Watcom: Use single quote for all file/path items in wlink commandJiri Malak2014-04-081-13/+21
|/ | | | | | Watcom Linker use single quote if necessary for quoting target name, libraries names and libraries search path. Object names were already fixed.
* Remove default labels from fully covered switch statements.Stephen Kelly2014-04-031-1/+0
| | | | | Allow compilers to warn when new enum values are added, making switches no-longer fully-covered.
* Merge topic 'target-transitive-sources'Brad King2014-04-031-3/+4
|\ | | | | | | | | | | | | | | | | | | | | 9407174b target_sources: New command to add sources to target. 81ad69e0 Make the SOURCES target property writable. 6e636f2e cmTarget: Make the SOURCES origin tracable. 3676fb49 cmTarget: Allow transitive evaluation of SOURCES property. e6971df6 cmTarget: Make the source files depend on the config. df753df9 cmGeneratorTarget: Don't add computed sources to the target. 869328aa cmComputeTargetDepends: Use valid config to compute target depends.
| * cmTarget: Make the source files depend on the config.Stephen Kelly2014-04-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disallow the use of config-specific source files with the Visual Studio and Xcode generators. They don't have any way to represent the condition currently. Use the same common-config API in cmQtAutoGenerators. While it accepts config-specific files, it doesn't have to support multiple configurations yet. Loop over the configs in cmTargetTraceDependencies and cmGlobalGenerator::WriteSummary and consume all source files. Loop over the configs in cmComputeTargetDepends and compute the object library dependencies for each config.
* | Merge topic 'target-sources-refactor'Brad King2014-04-031-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5de63265 Genex: Only evaluate TARGET_OBJECTS to determine target sources. aa0a3562 cmGeneratorTarget: Compute target objects on demand 042c1c83 cmTarget: Compute languages from object libraries on demand. fdcefe3c cmGeneratorTarget: Compute consumed object libraries on demand. c355d108 cmComputeTargetDepends: Track object library depends. e5da9e51 cmTarget: Allow any generator expression in SOURCES property. 5702e106 cmTarget: Include TARGET_OBJECTS genex in target SOURCES property. 857d30b5 cmGlobalGenerator: Add interface to call ForceLinkerLanguages 28e1d2f8 cmStringCommand: Add GENEX_STRIP subcommand. bf98cc25 Genex: Evaluate TARGET_OBJECTS as a normal expression. 8cd113ad cmTarget: Store strings instead of cmSourceFile* to represent SOURCES. 4959f341 cmSourceFileLocation: Collapse full path for directory comparisons. fcc92878 cmSourceFileLocation: Remove unused Update method. 59e8740a cmTarget: Remove AddSourceFile method 26d494ba cmTarget: Use string API to add sources to cmTarget objects. d38423ec cmTarget: Add a method to obtain list of filenames for sources. ...
| * cmTarget: Use string API to add sources to cmTarget objects.Stephen Kelly2014-03-311-2/+2
| | | | | | | | | | Continue to call GetOrCreateSource where necessary to create cmSourceFile objects which have the GENERATED attribute set.
* | Simplify multiple config handling.Stephen Kelly2014-04-021-11/+8
|/ | | | | Use conventional pattern of not repeating the loop body for empty config.