summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Makefile: Generate single-quoted object lists for WatcomJiri Malak2014-03-271-27/+12
|/ | | | | | | | | | | | | | | | Drop the CMAKE_NO_QUOTED_OBJECTS internal variable from the Makefile generators. The underlying problem is with the Watcom linker, not with WMake. The Watcom linker wants object files to be single-quoted. Add <LINK-RULE>_USE_WATCOM_QUOTE platform information variables to tell the generators to use Watcom-style single quotes for object files on link lines. On Windows, Watcom uses the GetCommandLine API to get the original command-line string and do custom parsing that expects single quotes. On POSIX systems, Watcom approximates the original command line by joining all argv[] entries separated by a single space. Therefore we need to double-quote the single-quoted arguments so that the shell does not consume them and they are available for the parser to see.
* cmGeneratorTarget: Constify cmSourceFile* in containers.Stephen Kelly2014-03-131-8/+8
| | | | | Some of them will be used with other APIs which require value_type to be cmSourceFile const*.
* Constify some APIs in generators.Stephen Kelly2014-03-131-4/+5
|
* cmOSXBundleGenerator: Make MacOSXContentGeneratorType arg const.Stephen Kelly2014-03-131-1/+1
|
* Generalize cmCustomCommandGenerator to more fieldsBrad King2014-03-121-12/+16
| | | | | | | Until now the cmCustomCommandGenerator was used only to compute the command lines of a custom command. Generalize it to get the comment, working directory, dependencies, and outputs of custom commands. Update use in all generators to support this.
* Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-3/+3
| | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* Remove some c_str() calls.Stephen Kelly2014-03-111-74/+74
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* stringapi: Use strings for dependency informationBen Boeckel2014-03-081-6/+4
|
* stringapi: Use strings for feature argumentsBen Boeckel2014-03-081-2/+2
|
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-5/+10
|
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-6/+6
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* stringapi: Use strings in target nameBen Boeckel2014-03-081-3/+3
|
* stringapi: Use strings for the languagesBen Boeckel2014-03-081-11/+11
|
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-1/+2
| | | | Variable names are always generated by CMake and should never be NULL.
* Windows: Use response files to specify link libraries for GNU toolsBrad King2014-03-051-1/+27
| | | | | | | | | Work around the command-line-length limit by using an @linklibs.rsp response file to pass the flags for link libraries. This allows very long lists of libraries to be used in addition to the existing support for passing object files via response file. Suggested-by: Peter Keuschnigg <peter.keuschnigg@pmu.ac.at>
* cmLocalGenerator: Add response file option to OutputLinkLibrariesBrad King2014-03-041-1/+1
| | | | | Response files require different path conversion to be threaded through construction of the link libraries flags.
* Makefile: Factor out some duplicate link libraries generationBrad King2014-03-041-0/+14
| | | | | | | The generators for executable and library targets duplicate the logic to call the OutputLinkLibraries helper on the local generator. Factor it out into a cmMakefileTargetGenerator::CreateLinkLibs method to avoid dpulication.
* Merge topic 'msvc-compiler-pdb-files'Brad King2014-02-261-0/+17
|\ | | | | | | | | | | | | | | | | fba51b09 MSVC: Add properties to configure compiler PDB files (#14762) 3737860a cmTarget: Add per-config compilation info 718a9532 cmTarget: Refactor ComputePDBOutputDir interface aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs b4aac0ca Makefile: Fix per-config linker PDB output directory
| * MSVC: Add properties to configure compiler PDB files (#14762)Brad King2014-02-261-0/+17
| | | | | | | | | | | | | | | | | | | | Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files 2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY properties. Those properties now exclusively handle linker PDB files. Since STATIC libraries do not link their compiler PDB file becomes more important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and "COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB file location and pass the value to the MSVC /Fd option.
* | cmGeneratorTarget: Use a method to access the definition file.Stephen Kelly2014-02-241-5/+6
|/
* Makefile: Fix comment indentation.Stephen Kelly2014-02-171-1/+1
|
* cmTarget: Make GetSourceFiles populate an out-vector parameter.Stephen Kelly2014-01-091-2/+2
| | | | | In a future patch, this will also be populated with extra sources from the linked dependencies.
* cmGeneratorTarget: Add methods to access source file groups.Stephen Kelly2014-01-091-9/+19
| | | | | These methods and others will be able to get a config parameter later to implement the INTERFACE_SOURCES feature.
* Merge topic 'fix-compile-OBJECT_DIR'Brad King2014-01-021-1/+1
|\ | | | | | | | | 03f3b4e Replace <OBJECT_DIR> rule placeholder consistently (#14667)
| * Replace <OBJECT_DIR> rule placeholder consistently (#14667)Brad King2014-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The <OBJECT_DIR> placeholder is supposed to be the base intermediate files directory for the current target. This is how it gets replaced during link line generation. However, during compile line generation we replace it with the directory containing the current object file which may be a subdirectory. Fix replacement of <OBJECT_DIR> in the generated compile lines to be the base intermediate files directory. This was expoxed by commit 42ba1b08 (VS: Separate compiler and linker PDB files, 2013-04-05) when we added a "/Fd<OBJECT_DIR>/" flag to the MSVC compile line in order to match the VS IDE default compiler program database location in the intermediate files directory. For source files in a subdirectory relative to the current target this caused the wrong location to be used for the compiler program database. This becomes particularly important when using precompiled headers. While at it, use the cmTarget::GetSupportDirectory method to compute the intermediate files directory for the current target instead of repeating the logic in a few places.
* | Remove INTERFACE build targets.Stephen Kelly2013-12-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY targets., 2013-08-21) extended the makefile generator to create build targets for INTERFACE_LIBRARY targets. No other generators were extended with this feature. This conflicts with the feature of whitelisting of target properties read from INTERFACE_LIBRARY targets. The INTERFACE_* properties of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY generator expressions for reading properties from the 'head target'. The 'head target' would be the INTERFACE_LIBRARY itself when creating the build rules for it, which means that non-whitelisted properties would be read.
* | Port some of the generator API to cmGeneratorTarget.Stephen Kelly2013-11-221-1/+1
| | | | | | | | | | | | | | Just enough to reach the BuildMacContentDirectory method and the NeedRelinkBeforeInstall methods. In the future, those methods can be moved to cmGeneratorTarget.
* | Makefile: Remove "forbidden" flags only as a wholeNils Gladitz2013-11-191-1/+34
| | | | | | | | | | | | Fix CMAKE_<LANG>_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS implementation to only remove whole flags. Without this n the Mac we were incorrectly removing -w from -Wno-write-strings.
* | Create make rules for INTERFACE_LIBRARY targets.Stephen Kelly2013-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is that the depends of the target are created. So, add_library(somelib foo.cpp) add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp) add_library(extra EXCLUDE_FROM_ALL foo.cpp) target_link_libraries(anotherlib extra) add_library(iface INTERFACE) target_link_libraries(iface INTERFACE anotherlib) Executing 'make iface' will result in the anotherlib and extra targets being made. Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY will not result in the executable being built with 'make iface' because of the logic in cmComputeTargetDepends::AddTargetDepend. So far, this is implemented only for the Makefile generator. Other generators will follow if this feature is possible for them. Make INTERFACE_LIBRARY targets part of the all target by default. Test this by building the all target and making the expected library EXCLUDE_FROM_ALL.
* | OS X: Encode -F framework search flag in per-language platform variableBrad King2013-10-101-3/+11
| | | | | | | | | | | | | | | | | | Compilers for languages other than C and C++ on OS X may not understand the -F framework search flag. Create a new platform information variable CMAKE_<LANG>_FRAMEWORK_SEARCH_FLAG to hold the flag, and set it for C and CXX lanugages in the Platform/Darwin module. Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-1/+6
|\ \ | | | | | | | | | | | | | | | | | | ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets 435c912 export: Add support for INTERFACE_LIBRARY targets fe73226 Add the INTERFACE_LIBRARY target type.
| * | Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-1/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This target type only contains INTERFACE_* properties, so it can be used as a structural node. The target-specific commands enforce that they may only be used with the INTERFACE keyword when used with INTERFACE_LIBRARY targets. The old-style target properties matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for this target type. The name of the INTERFACE_LIBRARY must match a validity generator expression. The validity is similar to that of an ALIAS target, but with the additional restriction that it may not contain double colons. Double colons will carry the meaning of IMPORTED or ALIAS targets in CMake 2.8.13. An ALIAS target may be created for an INTERFACE library. At this point it can not be exported and does not appear in the buildsystem and project files are not created for them. That may be added as a feature in a later commit. The generators need some changes to handle the INTERFACE_LIBRARY targets returned by cmComputeLinkInterface::GetItems. The Ninja generator does not use that API, so it doesn't require changes related to that.
* | Merge topic 'generate-modern-style'Brad King2013-10-071-7/+7
|\ \ | | | | | | | | | | | | | | | 027a020 Merge branch 'test-property-genex' into generate-modern-style 33055c4 Generate modern-style cmake code.
| * | Generate modern-style cmake code.Stephen Kelly2013-08-221-7/+7
| |/ | | | | | | | | | | | | | | | | | | | | The commits 9db31162 (Remove CMake-language block-end command arguments, 2012-08-13) and 77543bde (Convert CMake-language commands to lower case, 2012-08-13) changed most cmake code to use lowercase commands and no parameters in termination commands. However, those changes excluded cmake code generated in c++ by cmake. Make a similar style change to code generated by cmake.
* | Genex: Evaluate genexes for additional make clean files.Stephen Kelly2013-08-271-1/+9
|/ | | | | | | | | | | | | | | | | | | This is necessary because custom commands and targets may create custom files whose names are determined by generator expressions. For example, clang should be using $<TARGET_FILE> and $<TARGET_FILE_DIR> instead of reverse engineering the output file name: http://thread.gmane.org/gmane.comp.compilers.clang.scm/80523 However, that can only be done when ADDITIONAL_MAKE_CLEAN_FILES also accepts and evaluates generator expressions. Similarly, KDE uses the LOCATION property where $<TARGET_FILE> would also be better in KDE4_HANDLE_RPATH_FOR_EXECUTABLE but also appends the result to ADDITIONAL_MAKE_CLEAN_FILES. After this patch, both can be ported to generator expressions.
* Merge topic 'tid-system-argument'Brad King2013-07-161-1/+2
|\ | | | | | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * Add Target API to determine if an include is a system include.Stephen Kelly2013-07-021-1/+2
| | | | | | | | | | The implementation can be modified later so that system includes can be determined on a per-target basis.
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-3/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | d7dd010 Add target property debugging for COMPILE_DEFINITIONS 1841215 Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string. afc9243 Add an overload of cmIDEOptions::AddDefines taking a vector of strings. d95651e Overload cmLocalGenerator::AppendDefines to add a list.
| * | Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.Stephen Kelly2013-07-111-3/+2
| |/ | | | | | | Refactor to create AddCompileDefinitions.