summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmLocalGenerator: Remove 'optional' parameter from Convert.Stephen Kelly2015-06-041-3/+2
| | | | Port callers away from it.
* Remove CMAKE_USE_RELATIVE_PATHS variable.Stephen Kelly2015-06-031-7/+1
| | | | | | | | | | | | | | | | | The test for this variable was removed in commit v2.8.8~330^2~7 (complex: Remove ancient unused ComplexRelativePaths test, 2011-12-23). Commit v3.1.0-rc1~425^2~2 (backtrace: Convert to local paths in IssueMessage, 2014-03-12) appears to have accidentally made some backtraces print relative paths with the variable because conversions which used to be done at configure time, before the variable had an effect are now potentially done at generate time. The documentation of the variable says not to use it, and the docs are wrong in that the variable actually applies in per-directory scope. The read of the variable makes it harder to split conversion methods from cmLocalGenerator where they don't belong. Remove it now.
* Merge topic 'mingw32-make-backslash-workaround'Brad King2015-06-011-0/+1
|\ | | | | | | | | 7dd4a12c Revert "Makefile: Fix compilation after parent commit was backported"
| * Revert "Makefile: Fix compilation after parent commit was backported"Brad King2015-06-011-0/+1
| | | | | | | | | | | | This reverts commit bfa57c5f80278abc044b7342e81e5aaad82bffab. This change should not be part of 'master', only in 'release' for CMake 3.2.
* | Merge branch 'release'Brad King2015-06-011-1/+0
|\ \ | |/
| * Makefile: Fix compilation after parent commit was backportedBrad King2015-06-011-1/+0
| | | | | | | | | | The CMake 3.2 release branch does not have 'cmAlgorithms.h' and simply provides 'cmHasLiteralSuffix' in 'cmStandardIncludes.h' instead.
* | Merge topic 'run-include-what-you-use'Brad King2015-05-261-7/+7
|\ \ | | | | | | | | | | | | b3475ba5 Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERS
| * | Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERSBrad King2015-05-221-7/+7
| | | | | | | | | | | | | | | | | | The 'ctest --launch' command must be placed before the IWYU launcher on the compiler command line. Extend the RunCMake.IncludeWhatYouUse test to cover this case. The Ninja generator already does it correctly.
* | | Merge topic 'run-include-what-you-use'Brad King2015-05-211-0/+14
|\ \ \ | |/ / | | | | | | | | | | | | ada5ffce Add options to run include-what-you-use with the compiler 67fa3da9 cmake: Add internal -E mode to run include-what-you-use with the compiler
| * | Add options to run include-what-you-use with the compilerBrad King2015-05-191-0/+14
| | | | | | | | | | | | | | | | | | Create a <LANG>_INCLUDE_WHAT_YOU_USE target property (initialized by a CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable) to specify an IWYU command line to be run along with the compiler.
* | | cmGlobalUnixMakefileGenerator3: Host the include directive.Stephen Kelly2015-05-161-3/+3
|/ / | | | | | | There is no sense in copying this to each cmLocalGenerator.
* | Don't use a cmLocalGenerator instance to call static methods.Stephen Kelly2015-05-141-2/+2
| |
* | Merge topic 'mingw32-make-backslash-workaround'Brad King2015-05-041-0/+10
|\ \ | |/ | | | | | | bb6663ca Makefile: Workaround mingw32-make trailing backslash trouble (#15546)
| * Makefile: Workaround mingw32-make trailing backslash trouble (#15546)Brad King2015-05-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When given the command line tool a\ b c mingw32-make incorrectly passes "a b" and "c" to the tool. When given the command line tool a\ b "c" mingw32-make correctly passes "a\", "b", and "c" to the tool. Since commit v3.1.0-rc1~861^2 (MSVC: Add properties to configure compiler PDB files, 2014-02-24) we pass the compiler pdb option to MS-style compiler tools as "/Fd<dir>\" but mingw32-make may consume the backslash as escaping a following space as described above. Workaround this problem by changing the backslash to a forward slash as had been used prior to the above commit.
* | cmMakefile: Port users of GetStart* methods to new names.Stephen Kelly2015-04-201-8/+8
| |
* | cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-2/+2
| | | | | | | | Match names used in CMake code.
* | Port Global property interaction to cmState.Stephen Kelly2015-04-151-1/+3
| |
* | Merge topic 'custom-command-multiple-outputs'Brad King2015-04-131-24/+34
|\ \ | |/ | | | | | | | | 9660a3cc Makefile: Fix multiple custom command outputs with one missing 5c08e255 KWSys SystemTools: Teach Touch with !create to succeed on missing file
| * Makefile: Fix multiple custom command outputs with one missingBrad King2015-04-101-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of "cmake -E touch_nocreate" added in commit v3.2.1~4^2 (Makefile: Fix multiple custom command outputs regression, 2015-03-06) caused builds to fail when one of the outputs is intentionally not created. This was fixed by our parent commit by making touch_nocreate succeed when the file is missing. Add a test case covering it. For the Watcom WMake generator, check for the SYMBOLIC source file property separately on each output. The mark is needed on outputs that are not really created to tell 'wmake' not to complain that it is missing. The mark is also needed on outputs that are created or 'wmake' will not consider them out of date when they exist. Inspired-by: Ben Boeckel <ben.boeckel@kitware.com>
* | Makefile: Tell GNU make to delete rule outputs on error (#15474)Brad King2015-03-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add .DELETE_ON_ERROR to the "build.make" files that contain the actual build rules that generate files. This tells GNU make to delete the output of a rule if the recipe modifies the output but returns failure. This is particularly useful for custom commands that use shell redirection to produce a file. Do not add .DELETE_ON_ERROR for Borland or Watcom make tools because they may not tolerate it and would not honor it anyway. Other make tools that do not understand .DELETE_ON_ERROR will not be hurt. Suggested-by: Andrey Vihrov <andrey.vihrov@gmail.com>
* | Merge topic 'target-language-genex'Brad King2015-03-101-35/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 232a6883 Help: Add release notes for target-language-genex. 9e168941 File(GENERATE): Process genex evaluation files for each language. b734fa44 Genex: Allow COMPILE_LANGUAGE when processing include directories. 0b945ea9 Genex: Allow COMPILE_LANGUAGE when processing compile definitions. 5c559f11 Genex: Enable use of COMPILE_LANGUAGE for compile options. e387ce7d Genex: Add a COMPILE_LANGUAGE generator expression. 4a0128f4 VS6: Compute CMAKE_*_FLAGS and COMPILE_DEFINITIONS* only when needed
| * | Genex: Allow COMPILE_LANGUAGE when processing include directories.Stephen Kelly2015-03-091-34/+0
| | | | | | | | | | | | Issue an error if this is encountered by an IDE generator.
| * | Genex: Allow COMPILE_LANGUAGE when processing compile definitions.Stephen Kelly2015-03-091-1/+1
| | | | | | | | | | | | Issue an error if this is encountered by an IDE generator.
* | | Merge topic 'custom-command-multiple-outputs'Brad King2015-03-091-5/+74
|\ \ \ | |/ / |/| / | |/ | | 66a9c90c Makefile: Fix multiple custom command outputs regression (#15116)
| * Makefile: Fix multiple custom command outputs regression (#15116)Brad King2015-03-071-5/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit v3.2.0-rc1~272^2~2 (Makefile: Fix rebuild with multiple custom command outputs, 2014-12-05) we changed the generated makefile pattern for multiple outputs from out1: depends... commands... out2: out1 to out1 out2: depends... commands... This was based on the incorrect assumption that make tools would treat this as a combined output rule and run the command(s) exactly once for them. It turns out that instead this new pattern is equivalent to out1: depends... commands... out2: depends... commands... so the commands may be run more than once. Some documents suggest using a "dedicated witness" stamp file: stamp: depends... rm -f stamp touch stamp.tmp commands... mv stamp.tmp stamp out1 out2: stamp However, if the commands fail the error message will refer to the stamp instead of any of the real outputs, which may be confusing to readers. Also, this approach seems to have the same behavior of the original approach that motiviated the above commit: multiple invocations are needed to bring consumers of the outputs up to date. Instead we can return to the original approach but add an explicit touch to each extra output rule: out1: depends... commands... out2: out1 touch -c out2 This causes make tools to recognize that all outputs have changed and therefore to execute any commands that consume them.
* | Makefile: Fix output during parallel builds (#12991)Brad King2015-02-061-19/+17
|/ | | | | | | | | | Replace use of separate "cmake -E cmake_progress_report" and "cmake -E cmake_echo_color" commands to report the progress and message portions of build output lines with --progress-* options to the latter to print everything with a single command. The line buffering of the stdout FILE stream should cause the whole line to be printed with one atomic write. This will avoid inter-mixing of line-wise messages from different processes during a parallel build.
* IncludeDirectories: Respect SYSTEM flag when using CONFIG genex.Stephen Kelly2015-01-221-1/+2
| | | | | Update the Makefile and Ninja generators to use the config when requesting the include flags.
* Merge topic 'drop-ancient-workarounds'Brad King2015-01-121-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | All compilers hosting CMake support the std class.
* | Use insert instead of a loop in some cases.Stephen Kelly2015-01-111-27/+9
|/ | | | | | Limit this change to inserting into a vector from a vector. A follow up change can use insert for inserting into a set.
* Remove some temporary vectors for ExpandListArgument.Stephen Kelly2014-12-181-7/+1
| | | | Expand directly into the target when possible.
* Makefile: Fix rebuild with multiple custom command outputs (#15116)Brad King2014-12-051-84/+9
| | | | | | | Fix the generated makefiles for custom commands with multiple outputs to list all the outputs on the left hand side of the build rule. This is much simpler and more reliable than the old multiple-output-pair infrastructure.
* Merge topic 'link-no-empty-response-files'Brad King2014-12-021-1/+1
|\ | | | | | | | | 1c5be1f3 Makefile: Do not create an empty linker response file
| * Makefile: Do not create an empty linker response fileBrad King2014-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.1.0-rc1~821^2 (Windows: Use response files to specify link libraries for GNU tools, 2014-03-04) we use a response file to pass possibly long linker flag lists to the GNU linker on Windows. On MinGW, this may cause gfortran to use a response file to pass some flags to its own internal invocation. This is okay except when we are parsing implicit link flags from the compiler ABI detection build. If gfortran uses a response file in that case then we may miss extracting some of the implicit link flags, such as -lgfortran. Fortunately, in the compiler ABI detection case we do not actually link to anything so the response file is empty. Work around this problem by simply not using a response file when the list of flags it is used to pass is empty (or just whitespace). Reported-by: Bill Somerville <bill@classdesign.com>
* | Makefile: Add assembly and preprocessed targets for FortranTim Gallagher2014-11-101-2/+3
| | | | | | | | Extend the FortranOnly test to cover "make <src>.i" targets.
* | Makefile: Refactor checks for lang-specific targets and export compile cmdsTim Gallagher2014-11-051-4/+10
| | | | | | | | | | | | The checks are now split into languages that are able to generate assembly listings, languages that are able to generate preprocessed listings, and languages that are able to export the compile commands.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
|/ | | | | 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-1/+1
| | | | | | | | | | | | | | | | | 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.
* Makefile: Handle '#' in COMPILE_OPTIONS (#15070)Brad King2014-08-121-3/+7
| | | | | | | | | | Teach the Makefile generators to escape '#' characters on the right hand side of variable assignments in flags.make. This is needed for flags like '-Wno-error=#warnings'. Otherwise the make tool treats them as comments and leaves them out of the _FLAGS variable value. Add a case to the CompileOptions test covering '#' in a COMPILE_OPTIONS value, at least on compilers where it is known to be supported.
* cmLocalGenerator: Rename 'MAKEFILE' to 'MAKERULE'Brad King2014-07-221-3/+3
| | | | | Rename the internal enumeration value for converting paths destined for use in Makefile rule syntax.
* Merge topic 'dev/backtrace-performance'Brad King2014-06-091-2/+1
|\ | | | | | | | | | | | | | | | | | | 86be733f cmGeneratorExpression: Add workaround for Borland compiler 3495ab0a tests: update unused variable test expected output 2a1b2d84 backtrace: Convert to local paths in IssueMessage a0829205 genex: remove the need for backtraces efc20569 cmake: remove dummy backtraces for IssueMessage d46c650d cmMakefile: return a backtrace
| * genex: remove the need for backtracesBen Boeckel2014-06-051-2/+1
| | | | | | | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* | Add OBJECT_FILE_DIR rule placeholder for compilation linesBrad King2014-06-051-0/+5
|/ | | | | | | | | 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.
* cmTarget: Add GetFeatureAsBool methodBrad King2014-05-211-1/+1
| | | | Return the GetFeature method result converted to a boolean value.
* LocalGenerator: Add a string overload for AppendFlagsBen Boeckel2014-05-071-7/+7
|
* Watcom: Use single quote for all file/path items in wlink commandJiri Malak2014-04-081-2/+4
| | | | | | Watcom Linker use single quote if necessary for quoting target name, libraries names and libraries search path. Object names were already fixed.
* Merge topic 'target-transitive-sources'Brad King2014-04-031-12/+17
|\ | | | | | | | | | | | | | | | | | | | | 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-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Allow any generator expression in SOURCES property.Stephen Kelly2014-04-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove use of UseObjectLibraries from Makefile and Ninja generators. It is not needed now because those generators use GetExternalObjects which already contains the objects from object libraries. The VS10 generator calls both the UseObjectLibraries and the GetExternalObjects methods. Ensure that duplicates are not created by skipping objects from object libraries in handling of GetExternalObjects. Similarly, fix VS6, VS7 and Xcode object handling by skipping external objects from OBJECT_LIBRARY usage as appropriate. The error message in the BadSourceExpression1 test is now reported by the generator expression evaluator, so it has different text.