summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
Commit message (Collapse)AuthorAgeFilesLines
* MinGW: Update find_library to not find plain .dll filesBrad King2020-01-202-2/+2
| | | | | | | | Modern distributions of packages built with MinGW tools provide `.dll.a` import libraries. Prefer those instead of finding plain `.dll` files. This avoids accidentally finding unrelated Windows `.dll` files. Fixes: #20019
* Ninja: Add a separate job pool for PCH creationDan Johnston2020-01-161-1/+2
| | | | | | | Add a `JOB_POOL_PRECOMPILE_HEADER` target property to specify the pool name, and its associated `CMAKE_JOB_POOL_PRECOMPILE_HEADER` variable. Fixes: #20217
* Merge topic 'macOS-Xcode-11-frameworks'Brad King2020-01-131-0/+4
|\ | | | | | | | | | | | | | | fcde42751a FindPython: ensure new Xcode framework for Python3 is detected dd7b741b81 macOS: Add support for new Xcode 11 frameworks directory Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4198
| * macOS: Add support for new Xcode 11 frameworks directoryMarc Chevrier2020-01-101-0/+4
| | | | | | | | Update CMAKE_SYSTEM_FRAMEWORK_PATH with new Xcode 11 frameworks directory
* | Merge topic 'GNUtoMS-vs2019'Brad King2020-01-101-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 08c5b3eff0 GNUtoMS: Add search path for VS 2019 environment scripts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4197
| * | GNUtoMS: Add search path for VS 2019 environment scriptsBrad King2020-01-091-1/+1
| |/ | | | | | | | | | | | | | | Extend the logic from commit abe8a623d9 (GNUtoMS: Add search path for VS 2017 environment scripts, 2017-05-19, v3.8.2~1^2) to consider VS 2019 paths too. Fixes: #20162
* | Swift: move windows handling into platform file (NFC)Saleem Abdulrasool2019-12-221-0/+1
| | | | | | | | | | | | | | This moves the definition of the import library flags for Windows into a platform specific file (much like the Darwin `-sdk` flag). This is in preparation for re-use of the flag to make the flags handling for executables more precise.
* | Merge topic 'fat-ios'Brad King2019-12-171-11/+94
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | a9b41195d2 Handle multi-arch sysroots on Apple platforms 372c89ea38 Refactor -arch and -isysroot code usage 7a44e16d7f Refactor SDK name to path into a function 777d364913 Use xcrun instead of xcodebuild for resolving SDK path Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4125
| * | Handle multi-arch sysroots on Apple platformsTor Arne Vestbø2019-12-131-0/+79
| | |
| * | Refactor SDK name to path into a functionCristian Adam2019-12-111-11/+15
| | |
| * | Use xcrun instead of xcodebuild for resolving SDK pathTor Arne Vestbø2019-12-091-1/+1
| | | | | | | | | | | | It's much cheaper to run.
* | | MSVC: Fixed missing import library for Windows 10 ARM64 (Desktop)shibayan2019-12-101-1/+1
| | | | | | | | | | | | | | | | | | Add the same import library as x86/x64 by default for Windows 10 ARM64 (Desktop, not UWP). Fixes: #20077
* | | CUDA: forward unknown flags to host compiler when possible.Robert Maynard2019-11-291-12/+5
|/ / | | | | | | | | | | | | | | | | | | Starting with CUDA 10.2 the nvcc compiler has gained support to automatically forward unknown flags to the host compiler. This behavior is highly desired as projcts that mix CUDA, C, C++ run into situation where flags such as `-pthread` which aren't supported by nvcc, are being applied to all source files and therefore break CUDA compilation.
* | SDCC compiler: use sdar instead of sdcclib as librarian for recent versionsJohnny Jazeix2019-11-181-10/+24
| | | | | | | | Fixes: #19988
* | Merge topic 'cmake-e-rm'Kyle Edwards2019-11-152-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 2d0100fac7 replace remove and remove_directory with rm in tests 5239fc5c75 cmake -E: Add rm with improved semantics over remove and remove_directory Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3949
| * | replace remove and remove_directory with rm in testsJohnny Jazeix2019-11-132-2/+2
| | |
* | | Merge topic 'objc-link-main'Brad King2019-11-111-50/+26
|\ \ \ | |/ / |/| / | |/ | | | | | | db91c5f776 ObjC: Set same settings for all languages supported on Darwin Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4012
| * ObjC: Set same settings for all languages supported on DarwinCristian Adam2019-11-071-50/+26
| | | | | | | | Fixes: #19928
* | Merge topic 'objc-pch'Brad King2019-11-051-3/+0
|\ \ | |/ | | | | | | | | | | e331367a89 PCH: Add support for OBJC/OBJCXX languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3983
| * PCH: Add support for OBJC/OBJCXX languagesCristian Adam2019-11-031-3/+0
| |
* | Merge topic 'message-check-types'Craig Scott2019-11-041-6/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | 7b2dd9dedc Refactor: Use added message types in various modules 949a1e120a message: New message types to mark checks performed by CMake Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3689
| * | Refactor: Use added message types in various modulesAlex Turbov2019-11-021-6/+6
| | | | | | | | | | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* | | Merge topic 'swift-sdk-on-mac'Brad King2019-10-291-0/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | c10c9f839a Swift: Honor CMAKE_OSX_SYSROOT on Apple platforms Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3957
| * | Swift: Honor CMAKE_OSX_SYSROOT on Apple platformsBrad King2019-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Apple: Set Clang ASM compiler featuresGregor Jasny2019-10-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Android: add support for native compilation, such as with the Termux appButta2019-10-155-0/+35
| |/ |/| | | | | | | | | | | | | | | The CMake support for Android assumes cross-compilation using the NDK, so stub out that Android NDK support and use the Linux support that's already invoked. Set CMAKE_HOST_SYSTEM_NAME to "Android", rather than "Linux". Issue: #19840
* | Apple: Set Clang ASM compiler featuresGregor Jasny2019-10-071-0/+2
|/ | | | | | | | 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
* PCH: Use clang's own pch functionality instead of the GCC emulationCristian Adam2019-10-031-3/+4
| | | | Fixes: #19786
* Languages: Add support for Objective-C++Steve Wilson2019-09-284-3/+18
| | | | | | | | | | | | | | | | | 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 <cristian.adam@gmail.com>
* Languages: Add support for Objective-CSteve Wilson2019-09-284-1/+18
| | | | | | | | | | | | | | | | | 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 <cristian.adam@gmail.com>
* Precompile Headers: Add REUSE_FROM signatureCristian Adam2019-09-171-3/+10
| | | | | | | Add the ability to share precompiled headers artifacts between targets. Fixes: #19659
* Merge topic 'clang-ipo-support'Brad King2019-09-031-2/+9
|\ | | | | | | | | | | | | | | | | | | dca9c33abc Tests: Remove old IPO test c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm 079b8e2916 Clang: prefer lld-link over link.exe 6e3655db2c Clang: add LTO support for GNU-command line clang on windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3527
| * Clang: add LTO support for GNU-command line clang on windowsZsolt Parragi2019-08-271-2/+9
| |
* | Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-283-0/+23
|/ | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Merge topic 'solaris_clang'Brad King2019-08-192-0/+2
|\ | | | | | | | | | | | | 47937219ee Solaris: Add support for Clang compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3672
| * Solaris: Add support for Clang compilerLibor Bukata2019-08-092-0/+2
| | | | | | | | | | Inspired-by: Rainer Orth Fixes: #19456
* | Merge topic 'msvc-runtime-library-flang'Brad King2019-08-191-0/+5
|\ \ | | | | | | | | | | | | | | | | | | ea0294c281 Flang: Implement MSVC runtime library abstraction Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3674
| * | Flang: Implement MSVC runtime library abstractionBrad King2019-08-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit fb3370b6a1 (MSVC: Add abstraction for runtime library selection, 2019-04-10, v3.15.0-rc1~229^2) we overlooked updating flags for Flang on Windows. Add them now and update the MSVCRuntimeLibrary Fortran test to work with Flang. Base the flags on those we already use for the GNU-like Clang targeting the MSVC ABI. Fixes: #19583
* | | Clang: Fall back to llvm-rc when rc is unavailableGregory Mitrano2019-08-141-0/+15
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Make CMAKE_LINK_LIBRARY_FILE_FLAG work like CMAKE_LINK_LIBRARY_FLAGBrad King2019-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Android: Use unified toolchain in NDK r19+Brad King2019-07-266-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NDK build system now uses only a single toolchain in <ndk>/toolchains/llvm/prebuilt/<host> Its compilers are always `bin/{clang,clang++}` and its binutils are always `bin/<triple>-*`. It is a standalone toolchain: * The Anrdoid API level is specified at the end of `--target=`. * The standard library may be specified via `-stdlib=`. * No need to pass system includes or libraries explicitly. * No need to pass `--sysroot` or `-gcc-toolchain`. Teach CMake to recognize NDK versions that have a unified toolchain with its own sysroot and use the above approach. Fixes: #18739
* | Android: Re-order system initialization to select sysroot lastBrad King2019-07-261-2/+2
| |
* | Android: Clarify name of internal variable for arch tripleBrad King2019-07-262-12/+12
| | | | | | | | The triple applies to more than just header locations.
* | Android: Select NDK host tag while determining systemBrad King2019-07-264-32/+32
| | | | | | | | | | The host tag is tied to the host platform and does not depend on any specific language or compiler.
* | AIX: Do not enable runtime linking by default anymoreBrad King2019-07-172-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 0f150b69d3 (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 9f5c2040bf (AIX: Explicitly compute executable exports for both XL and GNU, 2019-07-12) and commit 2fa920c0cd (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
* | AIX: Create import library for executables with exportsBrad King2019-07-164-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 import libraries on Windows will now work for AIX linker import files too: * Plugins that link to their executable's symbols will be automatically linked using the import file on the command line. * The executable's import file will be (optionally) installed and exported for use in linking externally-built plugins. This will allow executables and their plugins to build even if we later turn off runtime linking. Issue: #19163
* | AIX: Explicitly compute executable exports for both XL and GNUBrad King2019-07-152-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | AIX: Explicitly compute shared object exports for both XL and GNUBrad King2019-07-153-20/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 d468a2c2cb (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
* | AIX: Drop redundant -brtl flagsBrad King2019-07-152-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We removed `-brtl` in commit bce7a2a3a5 (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 f254276fc1 (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
* | XL: De-duplicate shared object creation flagsBrad King2019-07-155-5/+0
|/ | | | | | 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.