diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -564,17 +564,21 @@ set(LLVM_DYLIB_COMPONENTS "all" CACHE STRING "Semicolon-separated list of components to include in libLLVM, or \"all\".") endif() -option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF) + if(MSVC) option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON) + # Set this variable to OFF here so it can't be set with a command-line + # argument. + set (LLVM_LINK_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}) endif() -set(LLVM_BUILD_LLVM_DYLIB_default OFF) -if(LLVM_LINK_LLVM_DYLIB OR (LLVM_BUILD_LLVM_C_DYLIB AND NOT MSVC)) - set(LLVM_BUILD_LLVM_DYLIB_default ON) -endif() -option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES))) diff --git a/llvm/docs/BuildingADistribution.rst b/llvm/docs/BuildingADistribution.rst --- a/llvm/docs/BuildingADistribution.rst +++ b/llvm/docs/BuildingADistribution.rst @@ -96,6 +96,7 @@ 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. Options for Optimizing LLVM =========================== diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst --- a/llvm/docs/CMake.rst +++ b/llvm/docs/CMake.rst @@ -570,11 +570,13 @@ 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. + This option is not available on Windows. **BUILD_SHARED_LIBS**:BOOL Flag indicating if each LLVM component (e.g. Support) is built as a shared diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -622,7 +622,8 @@ | | 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``. | +| | ``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 | diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -58,6 +58,9 @@ * 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. + .. NOTE If you would like to document a larger change, then you can add a subsection about it right here. You can copy the following boilerplate