Handle static libraries similar to shared libraries. Do not pass along
the shared library flags raw as that will pass flags for the linker to
the driver which is incorrect.
The `AssemblerListingLocation` setting in VS project files is meant for
intermediate files created during the build much like object files.
When the VS 7 generator was first under development, commit 49aebe6c99
(new arch, 2002-09-04) placed both object files and the ASM list
location in the same directory. Later commit f9aef0e422 (Generator now
creates a separate intermediate files directory for each target,
2005-07-27) moved the object files to a per-target directory but the
ASM list location was not moved with them. Move it now.
Fixes: #19480
When building with the built-in Curl, CMAKE_USE_OPENSSL is only set
to ON by default if an OpenSSL installation is detected. However, this
can cause the user to mistakenly build without OpenSSL support if
OpenSSL is not installed, because CMAKE_USE_OPENSSL is set to OFF in
that case. Always set CMAKE_USE_OPENSSL to ON by default on systems
where it could be available, skipping the initial detection, resulting
in an error when we try to use OpenSSL later on. Detect this error
and advise the user to either install OpenSSL or set CMAKE_USE_OPENSSL
to OFF.
Co-Authored-by: Brad King <brad.king@kitware.com>
In commit a605bf438e (Extend C++17/C++14 feature checks to cover more
standard library APIs, 2019-02-27, cpp-modules-20190312.1~52^2~1) we
added checks to the main build of CMake to verify C++14 capabilities
before using C++14 flags to build. Add these to the bootstrap check
too.
Define `PROTOBUF_USE_DLLS` on Windows when linking against dynamic
protobuf libraries so that we import symbols from them.
We use the condition `MSVC` to enable this because that is what
the upstream buildsystem uses.
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.
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
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
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