1. 31 Oct, 2018 1 commit
    • Brad King's avatar
      CSharp: Fix regression in VS project type selection for custom target · a56edad6
      Brad King authored
      A target created by `add_custom_target` should always be a `.vcxproj`
      file even if it has `.cs` sources involved in custom commands and such.
      The latter case was broken by refactoring in commit v3.12.0-rc1~160^2~7
      (remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget,
      2018-03-19).  The reason is that the `HasLanguage` method added by
      commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as
      wrapper for GetLanguages(), 2018-03-19) does not check the target type
      and so is not a suitable check for deciding the project file extension.
      
      The `HasLanguage` method was an attempt at an abstraction that turns
      out not to work very well.  Replace it with a dedicated `IsCSharpOnly`
      method that considers the target type, sources, and non-transitive
      `LINKER_LANGUAGE`.
      
      Fixes: #18515
      a56edad6
  2. 02 Oct, 2018 1 commit
    • Brad King's avatar
      CSharp: Fix regression in VS project type selection · 375b420f
      Brad King authored
      A that target contains only `.cs` sources should be generated as a
      `.csproj` project even if it links to non-CSharp static libraries.
      The latter case was broken by refactoring in commit v3.12.0-rc1~160^2~7
      (remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget,
      2018-03-19).  The reason is that the `HasLanguage` method added by
      commit v3.12.0-rc1~239^2~6 (cmGeneratorTarget: add HasLanguage() as
      wrapper for GetLanguages(), 2018-03-19) enforces its "exclusive" check
      on the combined set of source file languages and the link language.
      To restore the original `TargetIsCSharpOnly` semantics, update
      `HasLanguage` to enforce exclusiveness only on the list of sources.
      
      Fixes: #18239
      375b420f
  3. 25 Sep, 2018 2 commits
  4. 19 Sep, 2018 1 commit
  5. 18 Sep, 2018 1 commit
  6. 12 Sep, 2018 3 commits
    • Brad King's avatar
      target_link_libraries: Allow use with targets in other directories · a1ad0a69
      Brad King authored
      Previously the command did not allow naming targets on the LHS that
      were not created in the calling directory.  Lift this restriction to
      enable more flexible use by projects.
      
      Targets named on the RHS will need to be looked up during generation in
      the scope of the call site rather than the scope of the LHS target.
      Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties
      to specify target names that need to be looked up in a directory other
      than that containing the target on which the property is set.  Add
      minimal documentation of the syntax to help users that encounter it.
      
      Unfortunately CMake previously did allow such calls in the case that
      only `INTERFACE` libraries are specified, but those libraries would be
      looked up in the target's directory rather than the caller's.  Add
      policy `CMP0079` to enable the new behavior with new lookup scope in a
      compatible way.
      
      Fixes: #17943
      a1ad0a69
    • Brad King's avatar
    • Brad King's avatar
      Make internal TARGET_PROPERTY generator expressions more robust · 2f708f5d
      Brad King authored
      While collecting usage requirements from the `INTERFACE_*` properties of
      directly linked targets, we internally generate `TARGET_PROPERTY:` and
      `TARGET_OBJECTS:` generator expressions to refer to those properties on
      those targets.  At the point we generate these expressions we already
      have a pointer to an exact `cmGeneratorTarget` instance.
      
      Switch from using the target name in these generator expressions to
      using an internal unique name generated for each `cmGeneratorTarget`
      instance to be referenced.  This avoids depending on the user-facing
      target name to find the same target we already have.
      2f708f5d
  7. 10 Sep, 2018 1 commit
    • Brad King's avatar
      Fix transitive usage requirements through same-name imported targets · f35be599
      Brad King authored
      If two imported targets in different directories have the same name we
      should still be able to propagate transitive usage requirements from
      both.  Fix the DAG checker to work with target pointers instead of
      target names since the pointers will not be duplicated even if the names
      are.
      
      Fixes: #18345
      f35be599
  8. 07 Sep, 2018 2 commits
    • Brad King's avatar
      Fix dependency propagation through same-name imported targets · bea390e9
      Brad King authored
      If two imported targets in different directories have the same name we
      should still be able to propagate transitive link dependencies from
      both.  Fix the target and link dependency analyzers to de-duplicate
      targets using target pointers rather than target names since the
      pointers will not be duplicated even if the names are.
      
      Issue: #18345
      bea390e9
    • Brad King's avatar
      cmLinkItem: Convert to a "sum type" over a string and target pointer · fc7e4d1e
      Brad King authored
      Avoid exposing the item name implicitly as std::string.  When the item
      is a target, avoid storing a second copy of its name.
      
      Most link item construction is paired with calls to `FindTargetToLink`
      to get the possible target pointer.  Rename these methods to
      `ResolveLinkItem` and refactor them to construct the entire item.
      fc7e4d1e
  9. 05 Sep, 2018 1 commit
  10. 27 Aug, 2018 1 commit
  11. 15 Aug, 2018 1 commit
  12. 09 Aug, 2018 1 commit
  13. 07 Aug, 2018 1 commit
  14. 11 Jul, 2018 1 commit
  15. 02 Jul, 2018 1 commit
  16. 27 Jun, 2018 2 commits
  17. 06 Jun, 2018 2 commits
  18. 01 Jun, 2018 1 commit
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format-6.0 · d7204e64
      Kitware Robot authored
      Run the `clang-format.bash` script to update all our C and C++ code to a
      new style defined by `.clang-format`.  Use `clang-format` version 6.0.
      
      * If you reached this commit for a line in `git blame`, re-run the blame
        operation starting at the parent of this commit to see older history
        for the content.
      
      * See the parent commit for instructions to rebase a change across this
        style transition commit.
      d7204e64
  19. 21 May, 2018 1 commit
  20. 07 May, 2018 1 commit
  21. 23 Apr, 2018 1 commit
  22. 05 Apr, 2018 4 commits
  23. 14 Mar, 2018 1 commit
    • Brad King's avatar
      target_compile_options: Add syntax to specify shell strings · ce0b9832
      Brad King authored
      Options specified via `COMPILE_OPTIONS` and `INTERFACE_COMPILE_OPTIONS`
      are deduplicated, but individual options can legitimately be duplicated
      when grouped with other options, e.g.
      
          -D A -D B
      
      After deduplication that becomes `-D A B`.  Therefore we need a way to
      treat groups of options as units during deduplication.  A simple approach
      is to specify each group as one option, e.g.
      
          "-D A" "-D B"
      
      However, that conflicts with options that legitimately have spaces.  To
      break this ambiguity, add a `SHELL:` prefix syntax to specify that an
      option should be parsed like shell command line arguments after
      deduplication, e.g.
      
          "SHELL:-D A" "SHELL:-D B"
      
      These will survive deduplication intact, and then be parsed to produce
      `-D A -D B` on the final command line.
      
      Fixes: #15826
      ce0b9832
  24. 12 Mar, 2018 1 commit
    • Brad King's avatar
      Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories · 2deb9b7f
      Brad King authored
      When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating
      `INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the
      compile language through to the generator expression evaluator so
      that it can support `$<COMPILE_LANGUAGE:...>`.
      
      Fixes: #17811
      2deb9b7f
  25. 09 Mar, 2018 1 commit
  26. 01 Mar, 2018 3 commits
    • Deniz Bahadir's avatar
      objlib: Link object-files from `OBJECT` libraries. · 57538224
      Deniz Bahadir authored
      Note: This finally links the object-files of the `OBJECT` library from
      the right-hand side of `target_link_libraries` to the target on the
      left-hand side. However, this will only happen with directly linked
      `OBJECT` libraries, not with `OBJECT` libraries "linked" through
      property `INTERFACE_LINK_LIBRARIES` of a target on the right-hand side!
      
      Fixes: #14778
      57538224
    • Deniz Bahadir's avatar
      objlib: Allow `OBJECT` libraries to link to `OBJECT` libraries. · 9a7f039e
      Deniz Bahadir authored
      Note: This still does not link the object-files of the `OBJECT` library
      from the right-hand side of `target_link_libraries` to the target on the
      left-hand side. (In this particular case of another `OBJECT` library on
      the left-hand side this would not make any sense anyway. The target on
      the left-hand side has no link-step.)
      
      Issue: #14778
      9a7f039e
    • Deniz Bahadir's avatar
      objlib: Allow other libraries to link to `OBJECT` libraries. · dfb6e840
      Deniz Bahadir authored
      Note: This only allows `OBJECT` libraries to be on the right-hand side
      of `target_link_libraries` but still does not link its object-files to
      the target on the left-hand side.
      
      Issue: #14778
      dfb6e840
  27. 28 Feb, 2018 1 commit
    • Brad King's avatar
      Do not generate rules for .def generation where not supported · 1ac042aa
      Brad King authored
      Our `cmake -E __create_def` helper used for `WINDOWS_EXPORT_ALL_SYMBOLS`
      and merging of multiple `.def` files is available only with CMake hosted
      on Windows.  However, we may generate use of it on other platforms since
      commit v3.9.0-rc1~405^2 (Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def`
      files, 2017-03-13) when multiple `.def` files are listed.  This results
      in a build error because the tool doesn't exist.
      
      Fix our logic to avoid using the tool on non-Windows platforms.  Instead
      silently ignore all but the first `.def` source as we did before.
      
      Issue: #17773
      1ac042aa
  28. 31 Jan, 2018 2 commits
    • Ben Boeckel's avatar
      88ed556d
    • Pavel Solodovnikov's avatar
      Reduce raw string pointers usage. · 653b8946
      Pavel Solodovnikov authored
      * Change some functions to take `std::string` instead of
        `const char*` in the following classes: `cmMakeFile`, `cmake`,
        `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
        and a few others.
      * Greatly reduce using of `const char*` overloads for
        `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
      * Remove many redundant `c_str()` conversions throughout the code.
      653b8946