1. 21 Jan, 2019 1 commit
    • chuck cranor's avatar
      Compute implicit include directories from compiler output · 5990ecb7
      chuck cranor authored
       - CMakeParseImplicitIncludeInfo.cmake: new parser that extracts the
         compiler's include path from verbose output.  If the parser cannot
         parse the output, we fall back to the old behavior.  On osx we skip
         over framework directories (handled elsewhere).
       - CMakeDetermineCompilerABI.cmake:
           - use verbose flag in try_compile for ${src}
           - use new cmake_parse_implicit_include_info() to attempt extract
             implicit include directory path and if successful set
       - CMakeCCompiler.cmake.in and CMakeCXXCompiler.cmake.in - preserve
         CMAKE_${LANG}_IMPLICIT_INCLUDE_DIRECTORIES value between runs in
         the same way CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES is preserved
       - Tests/RunCMake/ParseImplicitIncludeInfo: tests for parse
         based on the older Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in.
         The test runs a set of verbose compiler outputs collected from
         various machines through the parser and checks the results.  New
         compiler files can be added by dropping input/output files in the
         ParseImplicitIncludeInfo/data subdirectory and then adding the new set
         of files to the ${targets} list in ParseImplicitIncludeInfo.cmake.
         There is a helper CMakeLists.txt in ParseImplicitIncludeInfo/data
         that can help with the generation of test input files.
         NOTE: the standard cmake pre-commit hook rejects verbose compiler
         output with trailing spaces... you have to manually edit them out.
         This shouldn't impact the test.
      Note that both the parser and the test code can use CMAKE_${LANG}_COMPILER_*
      variables such as ${CMAKE_CXX_COMPILER_ID} to decide how to parse
      verbose compiler output.  For the test code, this requires us to
      save the variables values in the test input files.
      Fixes: #16291
  2. 29 Oct, 2018 1 commit
    • Mateusz Zych's avatar
      MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe} · bd9bfc64
      Mateusz Zych authored
      CMake commands vs_link_dll and vs_link_exe, performing linking on MSVC,
      are responsible for calling resource compiler and manifest tool.
      Before this commit, both of these tools were called directly, with the
      expectation that they are available in the `PATH`. This has been fixed
      by respecting CMake variables `CMAKE_RC_COMPILER` and `CMAKE_MT`
      defining paths to these tools.
      Fixes: #17804
  3. 18 Jun, 2018 1 commit
  4. 27 Mar, 2018 1 commit
  5. 03 Oct, 2017 1 commit
  6. 29 Jun, 2017 1 commit
    • nolange's avatar
      Add a CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID variable · 0b1a2876
      nolange authored
      Compilers such as MSVC and IAR may have variants that target different
      architectures.  We have been using a `MSVC_<LANG>_ARCHITECTURE_ID`
      variable to hold this information for MSVC.  Add an alternative with a
      more general name (later we can port MSVC to it too).
      This additional information may be needed to generate proper invocations
      of the compiler based on its architecture variant.
  7. 03 Apr, 2017 1 commit
  8. 31 Mar, 2017 1 commit
    • Brad King's avatar
      Xcode: Detect CURRENT_ARCH for use by generator · a1221905
      Brad King authored
      During compiler identification, extract the Xcode `CURRENT_ARCH` value
      and save it for later use by the Xcode generator in an internal compiler
      information variable.  This will be useful to know the locations of
      object files when only one architecture is built.
  9. 08 Mar, 2017 1 commit
  10. 02 Dec, 2016 1 commit
  11. 12 Aug, 2016 1 commit
  12. 07 Dec, 2015 1 commit
  13. 23 Nov, 2015 1 commit
    • Brad King's avatar
      Revert "Disable shared library support when compiler links statically" (#15855) · 9682de56
      Brad King authored
      In commit v3.4.0-rc1~18^2 (Disable shared library support when compiler
      links statically, 2015-09-30) we tried to detect when the compiler is
      not capable of linking shared libraries (possibly due to flags in use).
      However, the approach is not robust against flags like `-nostdlib`.
      Revert it for now pending another solution to the original problem.
  14. 30 Sep, 2015 1 commit
    • Brad King's avatar
      Disable shared library support when compiler links statically · 8b4873a1
      Brad King authored
      When a user or a compiler wrapper adds '-static' to the compiler flags
      then it will always link static binaries.  Detect this from the compiler
      id binary and disable TARGET_SUPPORTS_SHARED_LIBS.  This will prevent
      projects from accidentally adding shared libraries when the toolchain
      does not support them.  It also helps CMake avoid linking with flags
      that require shared libraries to be supported.
  15. 18 Sep, 2015 3 commits
  16. 22 May, 2014 1 commit
  17. 16 Apr, 2014 1 commit
  18. 07 Apr, 2014 1 commit
    • Stephen Kelly's avatar
      project: Add infrastructure for recording CXX compiler features · faeddf64
      Stephen Kelly authored
      Add a feature test using the compiler macros and the preprocessor to
      determine available features.
      Add a CMAKE_CXX_COMPILE_FEATURES variable which contains all features
      known to the loaded compiler, and a CMAKE_CXX_KNOWN_FEATURES variable
      containing all features known to CMake.  Add language standard specific
      variables for internal use to determine the standard-specific compile
      flags to use.
      This will be extended to other languages in the future.  Follow-up
      commits will add features which will be recorded by the feature test.
  19. 20 Mar, 2014 1 commit
    • Tim Blechmann's avatar
      Treat .m files consistently as C across all generators · 95cdf132
      Tim Blechmann authored
      Objective C sources should be compiled with the C compiler, not C++.
      The Xcode generator correctly classifies ".m" sources already.  The
      cmSystemTools::GetFileFormat method was fixed by commit v2.8.0~1782 (fix
      for 7045, use gcc for .m, 2008-08-19) but it is not used by any of the
      generator since commit v2.4.0~2819 (major changes to support addition of
      languages, 2004-09-22).
      Fix the CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS table entries so that
      cmGlobalGenerator::GetLanguageFromExtension tells the Makefile, Ninja,
      and VS IDE generators to compile ".m" sources as C.  This makes behavior
      consistent on all generators.
      Signed-off-by: Tim Blechmann's avatarTim Blechmann <tim@klingt.org>
  20. 24 Oct, 2013 1 commit
  21. 04 Oct, 2013 1 commit
    • Brad King's avatar
      CMakeDetermineCompilerId: Add notion of "simulated" id/version · 51ab85c3
      Brad King authored
      Some compilers try to simulate other compilers as a drop-in replacement
      supporting all the same command-line options and predefined preprocessor
      macros.  In such cases it will be useful to have CMake load the compiler
      information files for the simulated compiler instead of duplicating the
      information.  Teach CMakeDetermineCompilerId to extract the simulated
      compiler id and version when the compiler id detection provides it.
  22. 11 Dec, 2012 1 commit
    • Brad King's avatar
      OS X: Detect implicit linker framework search paths · cc676c3a
      Brad King authored
      Previously we hard-coded a list of implicit framework directories but
      did not account for CMAKE_OSX_SYSROOT or for changes to the list across
      OS X versions.  Instead we should automatically detect the framework
      directories for the active toolchain.
      The parent commit added the "-Wl,-v" option to ask "ld" to print its
      implicit directories.  It displays a block such as:
       Framework search paths:
      Parse this block to extract the list of framework directories.
      Detection may fail on toolchains that do not list their framework
      directories, such as older OS X linkers.  Always treat the paths
       <sdk>/Network/Library/Frameworks # Older OS X only
      as implicit.  Note that /System/Library/Frameworks should always be
      considered implicit so that frameworks CMake finds there will not
      override the SDK copies.
  23. 21 Sep, 2012 1 commit
    • Brad King's avatar
      OS X: Always generate -isysroot if any SDK is in use · a0a0877a
      Brad King authored
      Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT.  Replace internal
      platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general
      CMAKE_${lang}_SYSROOT_FLAG variable.  If the -isysroot flag exists and
      CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to
      compiler command lines.  This is already done in the Xcode IDE.
  24. 24 Aug, 2012 2 commits
    • Brad King's avatar
      Store ABI detection results in compiler information files · e5fee8a7
      Brad King authored
      Drop use of cache entry CMAKE_DETERMINE_<LANG>_ABI_COMPILED and replace
      it with variable CMAKE_<LANG>_ABI_COMPILED.  Since the grandparent
      commit this test result is specific to the version of CMake.  Store it
      in the version-specific compiler information files instead of
      CMakeCache.txt so testing can be re-done to meet the requirements of the
      current version of CMake even if another version of CMake was already
      used to configure the build tree.
    • Brad King's avatar
      Move CMAKE_<LANG>_COMPILER_WORKS to compiler information files · 3df81b49
      Brad King authored
      Since the parent commit this test result is specific to the version of
      CMake.  Store it in the version-specific compiler information files
      instead of CMakeCache.txt so testing can be re-done to meet the
      requirements of the current version of CMake even if another version of
      CMake was already used to configure the build tree.
  25. 13 Aug, 2012 2 commits
    • Kitware Robot's avatar
      Remove CMake-language block-end command arguments · 9db31162
      Kitware Robot authored
      Ancient versions of CMake required else(), endif(), and similar block
      termination commands to have arguments matching the command starting the
      block.  This is no longer the preferred style.
      Run the following shell code:
      for c in else endif endforeach endfunction endmacro endwhile; do
          echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
      done >convert.sed &&
      git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
      egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
      egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
      xargs -0 sed -i -f convert.sed &&
      rm convert.sed
    • Kitware Robot's avatar
      Convert CMake-language commands to lower case · 77543bde
      Kitware Robot authored
      Ancient CMake versions required upper-case commands.  Later command
      names became case-insensitive.  Now the preferred style is lower-case.
      Run the following shell code:
      cmake --help-command-list |
      grep -v "cmake version" |
      while read c; do
          echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
      done >convert.sed &&
      git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
      egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
      xargs -0 sed -i -f convert.sed &&
      rm convert.sed
  26. 09 Jun, 2012 1 commit
  27. 08 Jun, 2012 1 commit
  28. 07 Dec, 2011 1 commit
    • Brad King's avatar
      Add framework to detect compiler version with its id (#12408) · fa7141f5
      Brad King authored
      Teach CMakePlatformId.h to construct an "INFO:compiler_version[]" string
      literal from macros COMPILER_VERSION_(MAJOR|MINOR|PATCH|TWEAK) to be
      defined in CMake(C|CXX)CompilerId.(c|cpp) for each compiler.  Provide
      conversion macros DEC() and HEX() to decode decimal or hex digits from
      integer values.  Parse the version out of the compiler id binary along
      with the other INFO values already present.
      Store the result in variable CMAKE_<LANG>_COMPILER_VERSION in the format
      "major[.minor[.patch[.tweak]]]".  Save the value persistently in
      CMake(C|CXX)Compiler.cmake in the build tree.  Document the variable for
      internal use since we do not set it everywhere yet.
      Report the compiler version on the compiler id result line e.g.
        The C compiler identification is GNU 4.5.2
      Report CMAKE_(C|CXX)_COMPILER_(ID|VERSION) in SystemInformation test.
  29. 08 Jun, 2011 1 commit
  30. 02 Sep, 2010 2 commits
  31. 11 Feb, 2010 1 commit
  32. 29 Jan, 2010 1 commit
    • David Cole's avatar
      Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always... · 6ee87b2e
      David Cole authored
      Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running.
  33. 28 Jan, 2010 1 commit
  34. 22 Jan, 2010 1 commit
  35. 19 Nov, 2009 1 commit