diff options
author | James Johnston <johnstonj.public@codenest.com> | 2015-10-08 17:14:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-10-08 17:53:51 (GMT) |
commit | 6556481eb8495a3c4f6870efc1b41b461f477bae (patch) | |
tree | c8e0039e06cf108e9643801ca13ad363beaf2179 /Help/command/add_library.rst | |
parent | 679a5d2185b15dcd0ff73f7c1c2d7d527c53de53 (diff) | |
download | CMake-6556481eb8495a3c4f6870efc1b41b461f477bae.zip CMake-6556481eb8495a3c4f6870efc1b41b461f477bae.tar.gz CMake-6556481eb8495a3c4f6870efc1b41b461f477bae.tar.bz2 |
Help: Document that SHARED libraries must export a symbol (#15775)
CMake assumes that a SHARED library compiled on Windows will export a LIB file.
This is not actually the case on Visual C++ if the library does not export any
symbols, and causes incremental builds to break if the user specifies SHARED
anyway. (Users should use MODULE libraries instead.)
Diffstat (limited to 'Help/command/add_library.rst')
-rw-r--r-- | Help/command/add_library.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst index fe7735c..5033e18 100644 --- a/Help/command/add_library.rst +++ b/Help/command/add_library.rst @@ -36,6 +36,12 @@ property is set to ``ON`` automatically. A ``SHARED`` library may be marked with the :prop_tgt:`FRAMEWORK` target property to create an OS X Framework. +If a library does not export any symbols, it must not be declared as a +``SHARED`` library. For example, a Windows resource DLL or a managed C++/CLI +DLL that exports no unmanaged symbols would need to be a ``MODULE`` library. +This is because CMake expects a ``SHARED`` library to always have an +associated import library on Windows. + By default the library file will be created in the build tree directory corresponding to the source tree directory in which the command was invoked. See documentation of the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`, |