summaryrefslogtreecommitdiff
path: root/Source/cmNinjaTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: Skip generating empty phony rulesAdam Strzelecki2014-06-301-13/+19
| | | | | | | | | Ninja generator ensures that all custom commands being target dependencies are run before other source compilations. However in case there are no such dependencies it currently generates empty phony rules which clutter the build graph. Teach the Ninja generator to produce such rules only when necessary.
* Add OBJECT_FILE_DIR rule placeholder for compilation linesBrad King2014-06-051-0/+6
| | | | | | | | | 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.
* Merge topic 'ninja-intel-linux'Brad King2014-05-121-2/+4
|\ | | | | | | | | 54535f47 Ninja: Fix deptype for Intel compiler on Linux
| * Ninja: Fix deptype for Intel compiler on LinuxBrad King2014-05-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | Since commit v3.0.0-rc1~305^2 (Ninja: deptype msvc for Intel's compiler on Windows, 2013-11-25) we used "deps = msvc" for the Intel compiler. This is correct only on Windows. On Linux we still want "deps = gcc". Fix the logic to use "deps = msvc" when the compiler id or the "simulate id" is "MSVC". This will preserve the behavior on Intel for Windows and fix the behavior on Intel for Linux. In the future this should be converted to a platform information module variable.
* | ninja: Factor out custom command order-only dependsBen Boeckel2014-05-071-14/+15
| | | | | | | | | | This makes WebKitGTK's CMake build.ninja file go from 165M to 11M and configure/generate in 5 seconds.
* | ninja: Factor out target-level order-only dependenciesBen Boeckel2014-05-071-5/+22
| | | | | | | | | | | | This reduces ninja file output even more for projects with lots of libraries with entangled transitive dependencies. ParaView goes from the previous 58M to about 45M.
* | LocalGenerator: Add a string overload for AppendFlagsBen Boeckel2014-05-071-2/+2
| |
* | ninja: Use string parametersBen Boeckel2014-05-021-3/+4
| |
* | Ninja: Query custom commands once per target, not once per file.Stephen Kelly2014-04-051-7/+7
| | | | | | | | | | Computing the source files is now more expensive, so the Ninja generator became very slow with a large number of files.
* | cmTarget: Make the source files depend on the config.Stephen Kelly2014-04-021-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | cmTarget: Allow any generator expression in SOURCES property.Stephen Kelly2014-04-021-11/+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.
* | ninja: Add support for custom depfile formatsBen Boeckel2014-03-231-0/+5
| | | | | | | | | | | | | | | | Not everything that isn't MSVC is GCC. I have support for LDC's depfile format on its way upstream[1], but its future is uncertain. CMake should at least support this for future depfile formats. [1]https://github.com/martine/ninja/pull/721
* | cmGeneratorTarget: Constify cmSourceFile* in containers.Stephen Kelly2014-03-131-10/+10
| | | | | | | | | | 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-5/+5
| |
* | cmOSXBundleGenerator: Make MacOSXContentGeneratorType arg const.Stephen Kelly2014-03-131-1/+1
| |
* | Generalize cmCustomCommandGenerator to more fieldsBrad King2014-03-121-1/+3
| | | | | | | | | | | | | | 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 some c_str() calls.Stephen Kelly2014-03-111-16/+16
| | | | | | | | | | | | 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 feature argumentsBen Boeckel2014-03-081-2/+2
| |
* | stringapi: Return a string reference for the configurationBen Boeckel2014-03-081-1/+1
| |
* | stringapi: Use strings for the languagesBen Boeckel2014-03-081-1/+1
| |
* | Merge topic 'msvc-compiler-pdb-files'Brad King2014-02-261-0/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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/+16
| |/ | | | | | | | | | | | | | | | | | | 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-3/+3
|/
* Ninja: Cache target-level flagsBen Boeckel2014-02-131-43/+48
| | | | | | Instead of figuring out target flags per-source file, cache the flags that are being used. This results in a *much* faster generate time for Ninja.
* cmGeneratorTarget: Add methods to access source file groups.Stephen Kelly2014-01-091-11/+23
| | | | | 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.
* | Merge topic 'ninja-compile-link-pool'Brad King2013-11-261-0/+13
|\ \ | | | | | | | | | | | | 7605e37 Ninja: job pool support for compiling and linking
| * | Ninja: job pool support for compiling and linkingPeter Kümmel2013-11-251-0/+13
| | | | | | | | | | | | | | | Could be tested by setting the environment variable NINJA_STATUS=[%r]
* | | Merge topic 'ninja-msvc-deps-for-intel'Brad King2013-11-261-4/+5
|\ \ \ | |/ / |/| | | | | | | | 76a8888 Ninja: deptype msvc for Intel's compiler on Windows
| * | Ninja: deptype msvc for Intel's compiler on WindowsPeter Kümmel2013-11-251-4/+5
| | |
* | | Port some of the generator API to cmGeneratorTarget.Stephen Kelly2013-11-221-2/+2
|/ / | | | | | | | | | | | | Just enough to reach the BuildMacContentDirectory method and the NeedRelinkBeforeInstall methods. In the future, those methods can be moved to cmGeneratorTarget.
* | Ninja: don't parse empty stringPeter Kümmel2013-11-041-5/+8
| |
* | Ninja: use deps = gcc/msvc featurePeter Kümmel2013-10-241-52/+73
|/ | | | cmcldeps is now only used for .rc file processing
* 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.
* | Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-17/+1
|/ | | | | | | This reverts commit de4da665d3205afa239749c41513a315c3831f51. This feature is not yet ready for release. It needs to be merged with the CMAKE_OSX_SYSROOT feature.
* Merge topic 'ninja_phony_targets'Brad King2013-07-011-12/+12
|\ | | | | | | | | | | | | 539356f Ninja: Custom Command file depends don't need to exist before building 874e171 Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static 88d27ad Add a test to expose a bug with add_custom_command and ninja.
| * Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non staticRobert Maynard2013-07-011-12/+12
| | | | | | | | | | | | To properly track the usage of dependencies that are generated at compile time as the side effect of other build steps we need to make the WriteBuild and WritePhonyBuild commands non static
* | Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handlingBrad King2013-06-271-32/+2
|/ | | | | | | | | | | | Replace the cmLocalGenerator GetCompileOptions method with an AddCompileOptions method since all call sites of the former simply append the result to a flags string anyway. Add a "lang" argument to AddCompileOptions and move the CMAKE_<LANG>_FLAGS_REGEX filter into it. Move the call sites in each generator to a location that has both the language and configuration available. In the Makefile generator this also moves the flags from build.make to flags.make where they belong.
* Use --sysroot when cross compiling.Stephen Kelly2013-06-071-1/+17
| | | | | | | | | | As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
* Merge topic 'VISIBILITY_PRESET-property'Brad King2013-06-051-0/+3
|\ | | | | | | | | | | cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property. 0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
| * Introduce target property <LANG>_VISIBILITY_PRESETStephen Kelly2013-06-021-0/+3
| | | | | | | | | | | | This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target property is used as the operand to the -fvisibility= compile option with GNU compilers and clang.
* | Merge topic 'target-COMPILE_OPTIONS'Brad King2013-06-031-4/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 24466f2 Add target_compile_options command. 80ca9c4 Add COMPILE_OPTIONS target property. 7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries 47f80d9 cmTarget: Rename struct to be more re-usable. 1319a14 Add <LANG>_COMPILER_ID generator expressions. 3549676 Add cmLocalGenerator::GetCompileOptions. f3ad863 VS6: Rename some variables to correspond to config values.
| * | Add cmLocalGenerator::GetCompileOptions.Stephen Kelly2013-06-021-4/+6
| |/ | | | | | | | | | | Currently it only adds the contents of the COMPILE_FLAGS target property, but it can be extended to handle a new COMPILE_OPTIONS generator expression enabled property.
* | Merge topic 'framework-refactor'Brad King2013-06-031-1/+1
|\ \ | |/ |/| | | | | 373faae Refactor how bundles and frameworks are supported.
| * Refactor how bundles and frameworks are supported.Clinton Stimpson2013-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make handling of directory separators consistent between non-bundle and bundle code. Remove xcode specific flag from cmTarget when getting install_name. Add (more) consistent convenience functions in cmTarget to get directories inside of bundles and frameworks to add files to. This refactor also fixes bug #12263 where frameworks had the wrong install name when SKIP_BUILD_RPATH. Also make install_name for frameworks consistent between Makefile and Xcode generator.