Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

  1. 28 Oct, 2019 1 commit
    • Brad King's avatar
      Swift: Honor CMAKE_OSX_SYSROOT on Apple platforms · c10c9f83
      Brad King authored
      Pass the value to the Swift compiler driver via `-sdk`.  We already do
      this for C/C++ via `-isysroot`.
      
      This fixes command-line builds on macOS 10.15 with Xcode 11 Swift tools.
      
      Fixes: #19880
      c10c9f83
  2. 09 Oct, 2019 1 commit
    • Gregor Jasny's avatar
      Apple: Set Clang ASM compiler features · 1a3a6225
      Gregor Jasny authored
      The same is done for the C and CXX language. This initializes
      compiler flags like the sysroot path or deployment target.
      
      Closes: #19794
      Suggested-by: Kyle Fleming
      1a3a6225
  3. 03 Oct, 2019 1 commit
  4. 28 Sep, 2019 2 commits
    • Steve Wilson's avatar
      Languages: Add support for Objective-C++ · 9e66397c
      Steve Wilson authored
      
      
      Add entries in Modules and Modules/Platform to support
      Objective-C++ compiler determination and identification.
      Add Modules to check Objective-C++ compiler flags, source
      compilations, program checks, etc...
      
      Use OBJCXX as the designator of the language, eg:
      
      project(foo OBJCXX)
      
      Add various tests for Objective-C++ language features.  Add
      tests to preserve C++ handling of .M and .mm files when
      Objective-C++ is not a configured language.
      Co-authored-by: Cristian Adam's avatarCristian Adam <cristian.adam@gmail.com>
      9e66397c
    • Steve Wilson's avatar
      Languages: Add support for Objective-C · 80f120a8
      Steve Wilson authored
      
      
      Add entries in Modules and Modules/Platform to support
      Objective-C compiler determination and identification.
      Add Modules to check Objective-C compiler flags, source
      compilations, program checks, etc...
      
      Use OBJC as the designator of the language, eg:
      
      project(foo OBJC)
      
      Add various tests for Objective-C language features.  Add
      tests to preserve C++ handling of .m and .mm files when
      OBJC is not a configured language.
      Co-Authored-By: Cristian Adam's avatarCristian Adam <cristian.adam@gmail.com>
      80f120a8
  5. 17 Sep, 2019 1 commit
  6. 28 Aug, 2019 1 commit
  7. 27 Aug, 2019 1 commit
  8. 14 Aug, 2019 1 commit
    • Gregory Mitrano's avatar
      Clang: Fall back to llvm-rc when rc is unavailable · cea253a3
      Gregory Mitrano authored
      This change modifies how CMAKE_RC_COMPILER is configured to improve
      the out-of-box experience for developers using Clang on Windows.
      The previous behavior was to require the user to explicitly specify
      the resource compiler when CMake was called. The new behavior
      is to automatically attempt to locate the MSVC rc binary and use that
      if it's found. If rc is not available, CMake will now fall back to
      Clang's llvm-rc binary.
      
      With this change in place, trivial C/C++ programs can be generated
      with Ninja and Clang on Windows without running into errors about
      a missing resource compiler.
      
      Fixes: #19318
      cea253a3
  9. 09 Aug, 2019 2 commits
  10. 02 Aug, 2019 1 commit
    • Brad King's avatar
      Make CMAKE_LINK_LIBRARY_FILE_FLAG work like CMAKE_LINK_LIBRARY_FLAG · f6d6dbc2
      Brad King authored
      The `CMAKE_LINK_LIBRARY_FILE_FLAG` variable is meant for linkers that
      want library file paths to be preceded by a flag.  This is used only
      for OpenWatcom to add the `library` argument before library file paths.
      Refactor the approach to treat `CMAKE_LINK_LIBRARY_FILE_FLAG` as a
      command-line string fragment to add just before the library file path.
      This has two advantages:
      
      * `CMAKE_LINK_LIBRARY_FILE_FLAG` now works like `CMAKE_LINK_LIBRARY_FLAG`.
      * `CMAKE_LINK_LIBRARY_FILE_FLAG` can now be an attached flag whose value
        is the library file path.
      
      Technically this is a change in behavior, but this setting was created
      for internal use and should be rarely used outside of CMake itself.
      
      Fixes: #19541
      f6d6dbc2
  11. 26 Jul, 2019 4 commits
  12. 17 Jul, 2019 1 commit
    • Brad King's avatar
      AIX: Do not enable runtime linking by default anymore · 3fb3157d
      Brad King authored
      We've long created shared objects on AIX using the linker's `-G` option
      (also offered by the XL front-end).  The `-G` option implies `-brtl` and
      enables runtime linking.  This has been largely unnecessary because we
      provide all dependencies on the link line and both XL and GNU compilers
      offer builtin behavior to export symbols.  Since commit 0f150b69 (AIX:
      Explicitly compute shared object exports for both XL and GNU,
      2019-07-11) we compute exports explicitly and consistently.
      Therefore runtime linking is no longer necessary for shared objects.
      
      We've also long created executables on AIX using the linker's `-brtl`
      option to enable runtime linking in case they load plugins at runtime.
      Since commit 9f5c2040 (AIX: Explicitly compute executable exports for
      both XL and GNU, 2019-07-12) and commit 2fa920c0 (AIX: Create import
      library for executables with exports, 2019-07-16) we now provide the
      linker enough information to fully resolve symbols in plugins up front.
      Therefore runtime linking is no longer necessary for executables.
      
      Drop use of `-G` for creating shared objects and use the XL `-qmkshrobj`
      and GCC `-shared` options instead.  Both invoke the linker with the
      `-bM:SRE -bnoentry` options to create a shared object without runtime
      linking enabled.  Also drop use of `-brtl` for creating executables.
      
      Issue: #19163
      3fb3157d
  13. 16 Jul, 2019 1 commit
    • Brad King's avatar
      AIX: Create import library for executables with exports · 2fa920c0
      Brad King authored
      On AIX, plugins meant to be loaded into executables via `dlopen` must be
      linked with access to a list of symbols exported from the executable in
      order to use them (when not using runtime linking).  The AIX linker
      supports specifying this list as an "import file" passed on the command
      line either via the `-bI:...` option or (with a leading `#! .` line) as
      a normal input file like any other library file.
      
      The linker import file plays the same role on AIX as import libraries do
      on Windows.  Teach CMake to enable its import library abstraction on AIX
      for executables with the `ENABLE_EXPORTS` target property set.  Teach
      our internal `ExportImportList` script to optionally generate a leading
      `#! .` line at the top of the generated export/import list.  Update our
      rule for linking an executable with exports to generate a public-facing
      "import library" implemented as an AIX linker import file.
      
      With this approach, our existing infrastructure for handling impo...
      2fa920c0
  14. 15 Jul, 2019 4 commits
    • Brad King's avatar
      AIX: Explicitly compute executable exports for both XL and GNU · 9f5c2040
      Brad King authored
      On AIX, symbols in executables must be exported in order to be visible
      to modules (plugins) they load via `dlopen`.  Prior to policy `CMP0065`,
      CMake linked all executables with flags to export symbols, but the NEW
      behavior for that policy is to do so only for executables that have the
      `ENABLE_EXPORTS` target property set.  In both cases, CMake has always
      used the AIX linker option `-bexpall` option to export symbols from
      executables.
      
      This has worked fairly well with the XL compiler, but with the GNU
      compiler it works only for C ABI symbols.  The reason is that `-bexpall`
      does not export symbols starting in `_` but the GNU C++ ABI mangles all
      symbols with a leading `_`.  Therefore we have only supported C ABI
      plugins with the GNU compiler on AIX.  Some projects have tried to work
      around this by replacing `-bexpall` with `-bexpfull`, but the latter
      often exports symbols that we do not want exported.
      
      Avoid using `-bexpall` for executables by instead using by our own
      internal `ExportImportList` script to compute symbol export lists from
      the object files to be linked into an executable.  Pass the explicitly
      computed export list to the AIX linker's `-bE:...` option.  We already
      do this for shared object exports.
      
      Issue: #19163
      9f5c2040
    • Brad King's avatar
      AIX: Explicitly compute shared object exports for both XL and GNU · 0f150b69
      Brad King authored
      On AIX, symbols in shared objects must be exported in order to be
      visible to dependents (similar to Windows).  The AIX linker provides a
      `-bE:...` option to specify a file listing symbols to be exported.
      Compilers offer some features to help:
      
      * When the XL compiler is invoked with its `-qmkshrobj`/`-G` options for
        creating shared objects (without/with runtime linking), it recognizes
        when no explicit `-bE:...` linker option is specified and runs a
        `CreateExportList` tool provided with the compiler to compute one from
        the object files.  Since commit d468a2c2 (XL: Avoid copying archives
        into shared libraries that link them, 2011-04-07, v2.8.5~153^2) CMake
        runs `CreateExportList` explicitly to ensure it only looks at the object
        files and not any library files.
      
      * When the GNU compiler is invoked with its `-shared` option for creating
        shared objects, its internal `collect2` tool recognizes when no explicit
        `-bE:...` linker option is specified and computes one itself from the
        object files.  However, it sometimes includes extra symbols such as
        `.__init_aix_libgcc_cxa_atexit`.
      
      Introduce our own internal `ExportImportList` script to compute symbol
      export lists from object files.  Use a basic implementation for now: it
      can be extended as needed later.  Update our shared library creation
      rules to run the script explicitly for both the XL and GNU compilers.
      
      Issue: #19163
      0f150b69
    • Brad King's avatar
      AIX: Drop redundant -brtl flags · a5bf4e79
      Brad King authored
      We removed `-brtl` in commit bce7a2a3 (AIX: Do not use -brtl to create
      shared libraries, 2013-03-11, v2.8.11~103^2~1) but it was added again by
      commit f254276f (AIX,HP-UX: Fix RPATH handling when CMP0065 is set to
      NEW, 2015-12-11, v3.4.2~4^2).  Since the latter commit we initialize the
      `CMAKE_{SHARED,MODULE}_LINKER_FLAGS` to use the `-brtl` linker flag.
      This is unnecessary because we already use the `-G` linker flag which
      implies `-brtl`.
      
      The latter commit also moved `-brtl` to `CMAKE_EXE_LINKER_FLAGS` from
      flags that were always included in executable link lines with CMP0065
      OLD behavior and are not part of the change intended by CMP0065.  Leave
      this for now as we've always enabled runtime linking for executables
      (and implicitly done so via -G for shared libraries and modules).
      
      Issue: #13997
      Issue: #19163
      a5bf4e79
    • Brad King's avatar
      XL: De-duplicate shared object creation flags · 9cb5f040
      Brad King authored
      The XL `-qmkshrobj` flag creates shared objects on all platforms.
      Move the flag out of the per-platform modules into the per-compiler
      module for XL.
      9cb5f040
  15. 26 Jun, 2019 1 commit
    • Brad King's avatar
      CUDA: Implement MSVC runtime library abstraction · 8fbd2577
      Brad King authored
      In commit fb3370b6 (MSVC: Add abstraction for runtime library
      selection, 2019-04-10, v3.15.0-rc1~229^2) we overlooked updating flags
      for CUDA on Windows, where nvcc uses MSVC as the host compiler.  Add
      them now and update the MSVCRuntimeLibrary test to cover CUDA.
      
      Fixes: #19428
      8fbd2577
  16. 19 Jun, 2019 1 commit
  17. 30 May, 2019 1 commit
  18. 23 May, 2019 1 commit
  19. 14 May, 2019 1 commit
  20. 30 Apr, 2019 4 commits
    • alcroito's avatar
      iOS: Only set the CMAKE_FIND_ROOT_PATH_MODE_* variables when not defined · 4783b842
      alcroito authored
      This allows overriding them in a toolchain file.
      4783b842
    • alcroito's avatar
      iOS: Only look for packages in the provided CMAKE_FIND_ROOT_PATHs · 5f5e3062
      alcroito authored
      Both CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and
      CMAKE_FIND_ROOT_PATH_MODE_LIBRARY are set to "ONLY" when cross
      building to iOS, but appears that CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
      was overlooked.
      
      This causes packages to be searched for in the host system as well,
      which is incorrect and can lead to linking issues.
      
      Set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to "ONLY" as well.
      
      CMAKE_FIND_ROOT_PATH_MODE_PROGRAM is not touched, because a user
      might want to find programs / tools on the host system.
      5f5e3062
    • alcroito's avatar
      iOS: Allow setting multiple CMAKE_FIND_ROOT_PATH values · 94c5fa5f
      alcroito authored
      Currently the value is hardcoded to contain only the sysroot for
      the respective darwin platform. This means that it can not be changed
      in a custom toolchain file.
      
      Instead of overriding the value, simply append it. This is similar
      to how it is done in the Google provided Android toolchain file.
      
      The usecase is to allow specifying addiitonal roots to look for
      3rd party packages which are definitely not present in the default
      sysroot.
      94c5fa5f
    • alcroito's avatar
      iOS: Allow specifying CMAKE_MACOSX_BUNDLE in toolchain file · 10113506
      alcroito authored
      Currently CMAKE_MACOSX_BUNDLE is always set to true when compiling
      for iOS. This poses a problem when using the source file
      variant of try_compile. Even if a custom value is passed via
      the CMAKE_FLAGS option, it would still be overridden by the
      Darwin.cmake file.
      
      Only set the value in case no other value was provided before.
      10113506
  21. 19 Apr, 2019 1 commit
    • Brad King's avatar
      MSVC: Do not add /W3 to CMAKE_<LANG>_FLAGS by default · 1baf122c
      Brad King authored
      We do not add default warning flags on other compilers, and having
      a warning flag in the default flags makes it hard for projects to
      customize the warning level.  They need to use string processing
      to remove `/W3` from `CMAKE_{C,CXX}_FLAGS`.  Therefore we should
      drop it.
      
      However, projects may be using string processing to replace `/W3`
      with another flag, so we cannot simply drop it.  Add a policy to
      drop it in a compatible way.
      
      Fixes: #18317
      1baf122c
  22. 17 Apr, 2019 1 commit
    • Brad King's avatar
      MSVC: Add abstraction for runtime library selection · fb3370b6
      Brad King authored
      Replace our hard-coded defaults for `/MD` and `/MDd` with a first-class
      abstraction to select the runtime library from an enumeration of logical
      names.  We've long hesitated to do this because the idea of "runtime
      library selection" touches on related concepts on several platforms.
      Avoid that scope creep by simply defining an abstraction that applies
      only when targeting the MSVC ABI on Windows.
      
      Removing the old default flags requires a policy because existing
      projects may rely on string processing to edit them and choose a runtime
      library under the old behavior.  Add policy CMP0091 to provide
      compatibility.
      
      Fixes: #19108
      fb3370b6
  23. 03 Apr, 2019 1 commit
  24. 29 Mar, 2019 1 commit
    • Fred Baksik's avatar
      GHS: Print status message regarding GHS_OS_DIR · 266dadf8
      Fred Baksik authored
      -- Rename platform script so it runs before initial try_compile() in
         project() command.
      -- Fix incorrect variable name GHS_OS_DIR_OPTION
      -- Remove unnecessary ".*" from REGEX expression for GHS_CANDIDATE_OS_DIRS
      -- Forward GHS_OS_DIR_OPTION to try_compile() and preserve trailing
         whitespace of the variable.
      266dadf8
  25. 21 Mar, 2019 1 commit
  26. 05 Mar, 2019 2 commits
  27. 01 Mar, 2019 1 commit
  28. 25 Feb, 2019 1 commit