Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Drop the CMAKE_NO_QUOTED_OBJECTS internal variable from the Makefile
generators. The underlying problem is with the Watcom linker, not with
WMake. The Watcom linker wants object files to be single-quoted. Add
<LINK-RULE>_USE_WATCOM_QUOTE platform information variables to tell the
generators to use Watcom-style single quotes for object files on link
lines.
On Windows, Watcom uses the GetCommandLine API to get the original
command-line string and do custom parsing that expects single quotes.
On POSIX systems, Watcom approximates the original command line by
joining all argv[] entries separated by a single space. Therefore we
need to double-quote the single-quoted arguments so that the shell does
not consume them and they are available for the parser to see.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
Work around the command-line-length limit by using an @linklibs.rsp
response file to pass the flags for link libraries. This allows
very long lists of libraries to be used in addition to the existing
support for passing object files via response file.
Suggested-by: Peter Keuschnigg <peter.keuschnigg@pmu.ac.at>
The generators for executable and library targets duplicate the logic to
call the OutputLinkLibraries helper on the local generator. Factor it
out into a cmMakefileTargetGenerator::CreateLinkLibs method to avoid
dpulication.
Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files
2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY
properties. Those properties now exclusively handle linker PDB files.
Since STATIC libraries do not link their compiler PDB file becomes more
important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and
"COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB
file location and pass the value to the MSVC /Fd option.
The <OBJECT_DIR> placeholder is supposed to be the base intermediate
files directory for the current target. This is how it gets replaced
during link line generation. However, during compile line generation
we replace it with the directory containing the current object file
which may be a subdirectory. Fix replacement of <OBJECT_DIR> in the
generated compile lines to be the base intermediate files directory.
This was expoxed by commit 42ba1b08 (VS: Separate compiler and linker
PDB files, 2013-04-05) when we added a "/Fd<OBJECT_DIR>/" flag to the
MSVC compile line in order to match the VS IDE default compiler program
database location in the intermediate files directory. For source files
in a subdirectory relative to the current target this caused the wrong
location to be used for the compiler program database. This becomes
particularly important when using precompiled headers.
While at it, use the cmTarget::GetSupportDirectory method to compute the
intermediate files directory for the current target instead of repeating
the logic in a few places.
Just enough to reach the BuildMacContentDirectory method and the
NeedRelinkBeforeInstall methods.
In the future, those methods can be moved to cmGeneratorTarget.
As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.
The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.
Make handling of directory separators consistent between
non-bundle and bundle code.
Remove xcode specific flag from cmTarget when getting install_name.
Add (more) consistent convenience functions in cmTarget to get
directories inside of bundles and frameworks to add files to.
This refactor also fixes bug #12263 where frameworks
had the wrong install name when SKIP_BUILD_RPATH.
Also make install_name for frameworks consistent between Makefile
and Xcode generator.
1e47ccb Ninja: add option to enforce usage of response files
e31df03 Ninja: move <OBJECTS> in front of the first linker option
8d674e7 Ninja: move -LIBPATH behind -link option
2ccca05 Run PDBDirectoryAndName test on MSVC and Intel
efc83b3 Document that PDB_(NAME|OUTPUT_DIRECTORY) are ignored for VS 6
b294457 Verify that PDB_(NAME|OUTPUT_DIRECTORY) are honored in test
3f60dbf Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
This enables changing the name and output folder of the debug symbol
files produced by MS compilers.
Inspired-by: Thomas Bernard <thomas.bernard@ipetronik.com>
Teach the Windows-GNU.cmake platform file to look for Visual Studio
tools matching the target ABI. Add an extra step to the link command
for shared libraries and executables that export symbols and on which a
new GNUtoMS property is set (initialized by the CMAKE_GNUtoMS option).
Tell the GNU linker to output a module definition (.def) file listing
exported symbols in addition to the GNU-format import library (.dll.a).
Pass the .def file to the MS "lib" tool to construct a MS-format DLL
import library (.lib).
Teach the install(TARGETS) command to install the MS import library next
to the GNU one. Teach the install(EXPORT) and export() command to set
the IMPORTED_IMPLIB property pointing at the import library to use the
import library matching the tools in the importing project.
This switches the internal generation order but does not affect the
results. The new order ensures that any internal state changed by
generating target-wide flags is known when the individual rules that use
those flags are generated.