diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -570,14 +570,11 @@ # Set this variable to OFF here so it can't be set with a command-line # argument. set (LLVM_LINK_LLVM_DYLIB OFF) + set(LLVM_BUILD_LLVM_DYLIB OFF) else() option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF) option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF) - set(LLVM_BUILD_LLVM_DYLIB_default OFF) - if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB) - set(LLVM_BUILD_LLVM_DYLIB_default ON) - endif() - option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) + set(LLVM_BUILD_LLVM_DYLIB ON) endif() option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) diff --git a/llvm/docs/BuildingADistribution.rst b/llvm/docs/BuildingADistribution.rst --- a/llvm/docs/BuildingADistribution.rst +++ b/llvm/docs/BuildingADistribution.rst @@ -93,10 +93,7 @@ One of the most powerful features of LLVM is its library-first design mentality and the way you can compose a wide variety of tools using different portions of LLVM. Even in this situation using *BUILD_SHARED_LIBS* is not supported. If you -want to distribute LLVM as a shared library for use in a tool, the recommended -method is using *LLVM_BUILD_LLVM_DYLIB*, and you can use *LLVM_DYLIB_COMPONENTS* -to configure which LLVM components are part of libLLVM. -Note: *LLVM_BUILD_LLVM_DYLIB* is not available on Windows. +want to distribute LLVM as a shared library then distribute the libLLVM.so library. Options for Optimizing LLVM =========================== @@ -152,8 +149,8 @@ The most impactful way to reduce binary size is to dynamically link LLVM into all the tools. This reduces code size by decreasing duplication of common code -between the LLVM-based tools. This can be done by setting the following two -CMake options to ``On``: *LLVM_BUILD_LLVM_DYLIB* and *LLVM_LINK_LLVM_DYLIB*. +between the LLVM-based tools. This can be done by setting the following +CMake option to ``On``: *LLVM_LINK_LLVM_DYLIB*. .. warning:: Distributions should never be built using the *BUILD_SHARED_LIBS* CMake @@ -166,7 +163,7 @@ help construct distributions. This is not an exhaustive list, and many additional options are documented in the :doc:`CMake` page. Some key options that are already documented include: *LLVM_TARGETS_TO_BUILD*, -*LLVM_ENABLE_PROJECTS*, *LLVM_BUILD_LLVM_DYLIB*, and *LLVM_LINK_LLVM_DYLIB*. +*LLVM_ENABLE_PROJECTS*, and *LLVM_LINK_LLVM_DYLIB*. **LLVM_ENABLE_RUNTIMES**:STRING When building a distribution that includes LLVM runtime projects (i.e. libcxx, diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst --- a/llvm/docs/CMake.rst +++ b/llvm/docs/CMake.rst @@ -562,20 +562,9 @@ $CMAKE_INSTALL_PREFIX/Toolchains containing an xctoolchain directory which can be used to override the default system tools. -**LLVM_BUILD_LLVM_DYLIB**:BOOL - If enabled, the target for building the libLLVM shared library is added. - This library contains all of LLVM's components in a single shared library. - Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS. - Tools will only be linked to the libLLVM shared library if LLVM_LINK_LLVM_DYLIB - is also ON. - The components in the library can be customised by setting LLVM_DYLIB_COMPONENTS - to a list of the desired components. - This option is not available on Windows. - **LLVM_LINK_LLVM_DYLIB**:BOOL If enabled, tools will be linked with the libLLVM shared library. Defaults - to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB - to ON. + to OFF. This option is not available on Windows. **BUILD_SHARED_LIBS**:BOOL @@ -585,8 +574,8 @@ mingw-w64, but not when building with the Microsoft toolchain. .. note:: BUILD_SHARED_LIBS is only recommended for use by LLVM developers. - If you want to build LLVM as a shared library, you should use the - ``LLVM_BUILD_LLVM_DYLIB`` option. + If you want to link against shared libraries, use libLLVM.so, which + is always available. **LLVM_OPTIMIZED_TABLEGEN**:BOOL If enabled and building a debug or asserts build the CMake build system will diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -618,13 +618,6 @@ | | slow and generates a lot of output. Sphinx version | | | 1.5 or later recommended. | +-------------------------+----------------------------------------------------+ -| LLVM_BUILD_LLVM_DYLIB | Generate libLLVM.so. This library contains a | -| | default set of LLVM components that can be | -| | overridden with ``LLVM_DYLIB_COMPONENTS``. The | -| | default contains most of LLVM and is defined in | -| | ``tools/llvm-shlib/CMakelists.txt``. This option is| -| | not avialable on Windows. | -+-------------------------+----------------------------------------------------+ | LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during | | | the LLVM build. This can dramatically speed up | | | debug builds. | diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -58,8 +58,11 @@ * The BasicBlockPass, BBPassManager and all their uses were deleted in `this revision `_. -* The LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB CMake options are no longer - available on Windows. +* The LLVM_LINK_LLVM_DYLIB CMake option is no longer available on Windows. + +* The LLVM_BUILD_LLVM_DYLIB option has been removed. The libLLVM shared object + is now always built on all platforms except Windows, so this option is no longer + necessary. .. NOTE If you would like to document a larger change, then you can add a diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt --- a/llvm/tools/llvm-shlib/CMakeLists.txt +++ b/llvm/tools/llvm-shlib/CMakeLists.txt @@ -1,6 +1,5 @@ -# This tool creates a shared library from the LLVM libraries. Generating this -# library is enabled by setting LLVM_BUILD_LLVM_DYLIB=yes on the CMake -# commandline. By default the shared library only exports the LLVM C API. +# This tool creates a shared library from the LLVM libraries. +# By default the shared library only exports the LLVM C API. set(SOURCES libllvm.cpp