1. 13 Apr, 2015 2 commits
    • Stephen Kelly's avatar
      cmMakefile: Remove unused CacheManager accessor. · f71fdf0e
      Stephen Kelly authored
      Remove unneeded friend declarations from cmCacheManager.
      f71fdf0e
    • Stephen Kelly's avatar
      Introduce cmState class. · a6b1ad13
      Stephen Kelly authored
      At this point, it is an interface to the cache.  It will be extended
      to be a universal interface for access to and manipulation of
      configuration-time data (defintions, properties on targets,
      directories, source files etc).
      
      This will allow porting all command implementations away
      from the cmMakefile and cmTarget classes, and result in something
      more-purely related to configuration-time processing of cmake
      commands.  That should serve at least the following goals:
      
       * Split the CMake implementation more definitively into three
         stages: Configuration, computation and generation, and be able to
         implement each optimally for memory access patterns etc.
       * Make better IDE integration possible by making more configuration
         data available.
       * Make it possiblte to use a smaller library than CMakeLib.a in
         cpack and ctest, resulting in smaller executables.
       * Make it possible to run the configure step multiple times in
         the same CMake run (#14539).
      
      Manage its lifetime in the cmake class, and add a convenience accessor
      to cmMakefile.
      a6b1ad13
  2. 07 Apr, 2015 2 commits
  3. 06 Apr, 2015 1 commit
  4. 05 Apr, 2015 1 commit
  5. 04 Apr, 2015 2 commits
  6. 01 Apr, 2015 6 commits
  7. 21 Feb, 2015 1 commit
  8. 06 Feb, 2015 1 commit
  9. 05 Feb, 2015 1 commit
  10. 12 Jan, 2015 1 commit
  11. 03 Dec, 2014 1 commit
  12. 26 Nov, 2014 1 commit
    • Ben Boeckel's avatar
      Revert "ClearMatches: Only clear matches which were actually set" (#15261) · 7d674b5f
      Ben Boeckel authored
      This reverts commit v3.1.0-rc1~557^2~2 (ClearMatches: Only clear matches
      which were actually set, 2014-03-12).  The optimization did not track
      the match count in the same scope as the variables, allowing possible
      inconsistency.
      
      Resolve conflicts in Source/cmIfCommand.cxx, Source/cmMakefile.cxx,
      and Source/cmMakefile.h by moving the changes to the new location
      of the code involved.
      7d674b5f
  13. 25 Nov, 2014 1 commit
    • Gregor Jasny's avatar
      Track nested loop levels in CMake language with a stack of counters · bae604d9
      Gregor Jasny authored
      
      
      It gets incremented while entering a loop block (e.g. foreach or while)
      and gets decremented when leaving the block. Because scope borders for
      example at function borders must be taken into account the counter is
      put into a stack. With every new scope an empty counter is pushed on the
      stack, when leaving the scope the original value is restored.
      
      This will allow easy querying if the break command is properly nested
      within a loop scope.
      Signed-off-by: Gregor Jasny's avatarGregor Jasny <gjasny@googlemail.com>
      bae604d9
  14. 14 Nov, 2014 2 commits
    • Brad King's avatar
      Add an option for explicit BYPRODUCTS of custom commands (#14963) · e15a7075
      Brad King authored
      A common idiom in CMake-based build systems is to have custom commands
      that generate files not listed explicitly as outputs so that these
      files do not have to be newer than the inputs.  The file modification
      times of such "byproducts" are updated only when their content changes.
      Then other build rules can depend on the byproducts explicitly so that
      their dependents rebuild when the content of the original byproducts
      really does change.
      
      This "undeclared byproduct" approach is necessary for Makefile, VS, and
      Xcode build tools because if a byproduct were listed as an output of a
      rule then the rule would always rerun when the input is newer than the
      byproduct but the byproduct may never be updated.
      
      Ninja solves this problem by offering a 'restat' feature to check
      whether an output was really modified after running a rule and tracking
      the fact that it is up to date separately from its timestamp.  However,
      Ninja also stats all dependencies up front and will only restat files
      that are listed as outputs of rules with the 'restat' option enabled.
      Therefore an undeclared byproduct that does not exist at the start of
      the build will be considered missing and the build will fail even if
      other dependencies would cause the byproduct to be available before its
      dependents build.
      
      CMake works around this limitation by adding 'phony' build rules for
      custom command dependencies in the build tree that do not have any
      explicit specification of what produces them.  This is not optimal
      because it prevents Ninja from reporting an error when an input to a
      rule really is missing.  A better approach is to allow projects to
      explicitly specify the byproducts of their custom commands so that no
      phony rules are needed for them.  In order to work with the non-Ninja
      generators, the byproducts must be known separately from the outputs.
      
      Add a new "BYPRODUCTS" option to the add_custom_command and
      add_custom_target commands to specify byproducts explicitly.  Teach the
      Ninja generator to specify byproducts as outputs of the custom commands.
      In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets
      that link, the byproducts must be specified as outputs of the link rule
      that runs the commands.  Activate 'restat' for such rules so that Ninja
      knows it needs to check the byproducts, but not for link rules that have
      no byproducts.
      e15a7075
    • Peter Collingbourne's avatar
      Add USES_TERMINAL option for custom commands · fe5d6e8c
      Peter Collingbourne authored
      Teach the add_custom_command and add_custom_target commands a new
      USES_TERMINAL option.  Use it to tell the generator to give the command
      direct access to the terminal if possible.
      fe5d6e8c
  15. 15 Oct, 2014 1 commit
  16. 11 Sep, 2014 1 commit
  17. 31 Jul, 2014 1 commit
  18. 08 Jul, 2014 1 commit
  19. 05 Jun, 2014 1 commit
    • Ben Boeckel's avatar
      cmMakefile: return a backtrace · d46c650d
      Ben Boeckel authored
      This allows backtraces to be fully controlled by the makefile rather
      than externally (and makes changing how they are manipulated easier).
      d46c650d
  20. 22 May, 2014 2 commits
  21. 21 May, 2014 1 commit
    • Stephen Kelly's avatar
      Features: Add COMPILE_FEATURES generator expression. · 0dfe395e
      Stephen Kelly authored
      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.
      0dfe395e
  22. 20 May, 2014 4 commits
  23. 14 May, 2014 1 commit
    • Stephen Kelly's avatar
      Features: Extend concept to C language. · e0890d03
      Stephen Kelly authored
      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.
      e0890d03
  24. 08 May, 2014 1 commit
    • Ben Boeckel's avatar
      EVIS: Reimplement using custom parsing code · bc385658
      Ben Boeckel authored
      Introduce a new implementation of ExpandVariablesInString and select
      between the old and new implementations based on policy CMP0053.
      Instead of cmCommandArgumentParserHelper, use a custom parser with our
      own stack.  This is much faster and works well for our simple grammar.
      
      The new behavior of CMP0053 should expand @VAR@ syntax only in certain
      contexts.  All existing EVIS callers use "replaceAt == true" so
      hard-code our call to the old implementation.  Update the signature to
      default to "replaceAt == false" and pass "replaceAt == true" explicitly
      in the call sites for configure_file and string(CONFIGURE).
      
      Testing the configure (no generate) step with ParaView shows ~20%
      performance improvement.
      
      In terms of complete configure/generate steps, further testing with
      ParaView shows a 20% performance improvement over 2.8.12.2 with Unix
      Makefiles and minimal with Ninja. Ninja is less because it generate step
      is the expensive part (future work will address this) by a long shot and
      these changes help the configure step for the most part.
      bc385658
  25. 07 May, 2014 1 commit
  26. 29 Apr, 2014 1 commit
    • Ben Boeckel's avatar
      ClearMatches: Only clear matches which were actually set · f718b30a
      Ben Boeckel authored
      ClearMatches was clearing many variables which were never set in the
      first place. Instead, store how many matches were made last time and
      only clear those. It is moved to the cmMakefile class since it is a
      common utility used by multiple commands.
      f718b30a
  27. 07 Apr, 2014 1 commit
    • Stephen Kelly's avatar
      cmTarget: Add COMPILE_FEATURES target property. · 03355d6b
      Stephen Kelly authored
      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.
      03355d6b