summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Genex: Move TARGET_PROPERTY linked targets evaluation to endBrad King2019-07-211-35/+28
|
* cmGeneratorTarget: Refactor usage requirement genex evaluationBrad King2019-07-191-270/+209
| | | | | | | | | Evaluate usage requirement generator expressions fully before entering the processing loops. This allows us to evaluate and collect all entries up front and then have only one call to the loop over them. This also allows `AddInterfaceEntries` to immediately evaluate the generator expressions it synthesizes, which will enable later optimization.
* cmGeneratorTarget: Move static functions to anonymous namespaceBrad King2019-07-191-26/+43
|
* cmGeneratorTarget: Order usage requirement processing logic consistentlyBrad King2019-07-191-10/+11
| | | | | Re-order logic in all `process*` methods so that they all evaluate generator expressions at the beginning of their loops.
* cmGeneratorTarget: Remove unnecessary copy to local variableBrad King2019-07-191-4/+3
|
* cmGeneratorTarget: Remove unused member of internal classBrad King2019-07-191-3/+0
|
* cmGeneratorExpressionDAGChecker: Avoid const_castBrad King2019-07-192-4/+2
| | | | Make a member mutable to avoid casting away const of a whole object.
* CMake Nightly Date StampKitware Robot2019-07-191-1/+1
|
* Merge branch 'release-3.15'Brad King2019-07-180-0/+0
|\
| * Merge branch 'backport-swift-improvements' into release-3.15Brad King2019-07-185-15/+72
| |\ | | | | | | | | | Merge-request: !3568
* | \ Merge topic 'swift-improvements'Brad King2019-07-180-0/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f19c189e74 Merge branch 'backport-swift-improvements' into swift-improvements 5803a8a2f7 Swift: support SONAME on ELFish targets 47e28cbe1f Swift: support multithreaded compilation 6814567e8c Swift: add rules for static linking c8741e8ff5 Swift: Add library search paths for dependencies be0d404208 Support per-language library link flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3568
| * \ \ Merge branch 'backport-swift-improvements' into swift-improvementsBrad King2019-07-180-0/+0
| |\ \ \ |/ / / / | | | _
| * | Swift: support SONAME on ELFish targetsSaleem Abdulrasool2019-07-181-2/+5
| | | | | | | | | | | | | | | | | | We should enable the soname to be setup for ELF shared libraries. Failure to do so generates binaries with incorrect names which prevents loading.
| * | Swift: support multithreaded compilationSaleem Abdulrasool2019-07-183-6/+19
| | | | | | | | | | | | | | | Query the number of logical CPUs available to enable parallel compilation for Swift.
| * | Swift: add rules for static linkingSaleem Abdulrasool2019-07-181-0/+6
| | | | | | | | | | | | | | | | | | The Swift driver recently learnt how to generate static libraries using the `-static` flag. This enables us to generate proper static libraries with dependency tracking with Swift as well.
| * | Swift: Add library search paths for dependenciesSaleem Abdulrasool2019-07-181-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building Swift executables and libraries which import a module, an implicit link will be added by the driver. Because this links by name rather than path, the library search path needs to be provided to indicate where to find the library. For all local dependencies, add the library paths for the targets when linking. This ensures that you can link against local libraries without explicitly setting a library path. Fixes: #19304
| * | Support per-language library link flagsSaleem Abdulrasool2019-07-182-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behaviour of the generators to use a per-language library search path flag. This is needed for multi-language projects with different compilers (e.g. cl + gfortran). Since the adjusted variable has been part of the user settings, we control this based on a policy. Fixes: #19307
* | | Merge branch 'release-3.15'Brad King2019-07-180-0/+0
|\ \ \ | | |/ | |/|
| * | Merge branch 'FindPython-interpreter-crosscompiling' into release-3.15Brad King2019-07-181-11/+10
| |\ \ | | |/ | |/| | | | Merge-request: !3564
* | | Merge topic 'FindPython-interpreter-crosscompiling'Brad King2019-07-181-11/+10
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 696d0f9caf FindPython: ensure interpreter is founded when cross-compiling Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3564
| * | FindPython: ensure interpreter is founded when cross-compilingMarc Chevrier2019-07-181-11/+10
| |/ | | | | | | Fixes: #19473
* | Merge topic 'aix-no-rtl'Brad King2019-07-183-14/+12
|\ \ | | | | | | | | | | | | | | | | | | 3fb3157dae AIX: Do not enable runtime linking by default anymore Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3566
| * | AIX: Do not enable runtime linking by default anymoreBrad King2019-07-173-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | CMake Nightly Date StampKitware Robot2019-07-181-1/+1
| | |
* | | Merge branch 'release-3.15'Brad King2019-07-170-0/+0
|\ \ \ | |/ / |/| / | |/
| * CMake 3.15.0v3.15.0Brad King2019-07-171-1/+1
| |
* | Merge topic 'aix-exe-implib'Brad King2019-07-1718-16/+68
|\ \ | | | | | | | | | | | | | | | | | | 2fa920c0cd AIX: Create import library for executables with exports Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3561
| * | AIX: Create import library for executables with exportsBrad King2019-07-1618-16/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'cmake-qch-no-version-in-filename'Brad King2019-07-174-12/+10
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 0518e675ea CMake.qch: Don't include the version in the file name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3558
| * | | CMake.qch: Don't include the version in the file nameCraig Scott2019-07-174-12/+10
| | | | | | | | | | | | Fixes: #19374
* | | | Merge topic 'project-version-0'Brad King2019-07-1715-66/+215
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0ba5891ead project: Keep leading `0` in PROJECT_VERSION components 5f84669806 Tests: Factor out RunCMake.project helper macro into module b1f387a7ea Refactor: Use raw string literals instead of escaping 41b85968d8 Refactor: Use initializer lists instead of `push_back` series 45e85dd2b2 Refactor: Add some `const` to vars 90f91e4d21 Refactor: Replace a "magic" number w/ a named constant 638383c38f Refactor: Eliminate one-time-used variables 9b6a53292f Refactor: Eliminate `sep` from the loop Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3517
| * | | | project: Keep leading `0` in PROJECT_VERSION componentsAlex Turbov2019-07-1613-29/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce CMake policy `CMP0096` to make `project()` keep leading zeros in version components. As a side effect, it now allows really long version numbers. Fixes: #19421 Co-Author: Brad King <brad.king@kitware.com>
| * | | | Tests: Factor out RunCMake.project helper macro into moduleBrad King2019-07-152-6/+7
| | | | |
| * | | | Refactor: Use raw string literals instead of escapingAlex Turbov2019-07-151-1/+1
| | | | |
| * | | | Refactor: Use initializer lists instead of `push_back` seriesAlex Turbov2019-07-151-13/+11
| | | | |
| * | | | Refactor: Add some `const` to varsAlex Turbov2019-07-151-3/+3
| | | | |
| * | | | Refactor: Replace a "magic" number w/ a named constantAlex Turbov2019-07-151-4/+5
| | | | |
| * | | | Refactor: Eliminate one-time-used variablesAlex Turbov2019-07-151-12/+6
| | | | |
| * | | | Refactor: Eliminate `sep` from the loopAlex Turbov2019-07-151-3/+1
| | | | |
* | | | | Merge branch 'release-3.15'Brad King2019-07-170-0/+0
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merge branch 'find_package-fix-NO_MODULE' into release-3.15Brad King2019-07-164-2/+38
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Merge-request: !3557
* | \ \ \ \ Merge topic 'find_package-fix-NO_MODULE'Brad King2019-07-174-2/+38
|\ \ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | f2edccea66 find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3557
| * | | | | find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIGCristian Adam2019-07-164-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The module mode fallback added by commit 22e65d10c1 (find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback, 2019-06-13, v3.15.0-rc2~6^2) should not be used unless the `find_package` call allows module mode. Doing so can lead to infinite recursion if a find module tries to call config mode with `find_package(... NO_MODULE)`. Fix the logic and add a test case. Fixes: #19478
* | | | | | CMake Nightly Date StampKitware Robot2019-07-171-1/+1
| |_|_|_|/ |/| | | |
* | | | | Merge topic 'aix-explicit-exports'Brad King2019-07-1616-39/+106
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c2c3d22504 Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexit 9f5c2040bf AIX: Explicitly compute executable exports for both XL and GNU 0f150b69d3 AIX: Explicitly compute shared object exports for both XL and GNU a5bf4e7921 AIX: Drop redundant -brtl flags 9cb5f040d7 XL: De-duplicate shared object creation flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3556
| * | | | | Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexitBrad King2019-07-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the filtering added by commit e22c45d4c9 (Tests: Teach RunCMake to ignore AIX ld warnings about GNU atexit, 2018-02-28, v3.12.0-rc1~419^2~6). It is no longer needed now that we compute our own exports on AIX and do not get these warnings when using shared libraries.
| * | | | | AIX: Explicitly compute executable exports for both XL and GNUBrad King2019-07-158-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-156-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.