Skip to content

Commit 3ffbf97

Browse files
committed
[cmake] Remove LLVM_{BUILD,LINK}_LLVM_DYLIB options on Windows
Summary: The options aren't supported so they can be removed. Reviewers: beanz, smeenai, compnerd Reviewed By: compnerd Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69877
1 parent 7599484 commit 3ffbf97

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

llvm/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,17 +564,21 @@ if(NOT DEFINED LLVM_DYLIB_COMPONENTS)
564564
set(LLVM_DYLIB_COMPONENTS "all" CACHE STRING
565565
"Semicolon-separated list of components to include in libLLVM, or \"all\".")
566566
endif()
567-
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
567+
568568
if(MSVC)
569569
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON)
570+
# Set this variable to OFF here so it can't be set with a command-line
571+
# argument.
572+
set (LLVM_LINK_LLVM_DYLIB OFF)
570573
else()
574+
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
571575
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
576+
set(LLVM_BUILD_LLVM_DYLIB_default OFF)
577+
if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB)
578+
set(LLVM_BUILD_LLVM_DYLIB_default ON)
579+
endif()
580+
option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
572581
endif()
573-
set(LLVM_BUILD_LLVM_DYLIB_default OFF)
574-
if(LLVM_LINK_LLVM_DYLIB OR (LLVM_BUILD_LLVM_C_DYLIB AND NOT MSVC))
575-
set(LLVM_BUILD_LLVM_DYLIB_default ON)
576-
endif()
577-
option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
578582

579583
option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
580584
if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES)))

llvm/docs/BuildingADistribution.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ LLVM. Even in this situation using *BUILD_SHARED_LIBS* is not supported. If you
9696
want to distribute LLVM as a shared library for use in a tool, the recommended
9797
method is using *LLVM_BUILD_LLVM_DYLIB*, and you can use *LLVM_DYLIB_COMPONENTS*
9898
to configure which LLVM components are part of libLLVM.
99+
Note: *LLVM_BUILD_LLVM_DYLIB* is not available on Windows.
99100

100101
Options for Optimizing LLVM
101102
===========================

llvm/docs/CMake.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,13 @@ LLVM-specific variables
570570
is also ON.
571571
The components in the library can be customised by setting LLVM_DYLIB_COMPONENTS
572572
to a list of the desired components.
573+
This option is not available on Windows.
573574

574575
**LLVM_LINK_LLVM_DYLIB**:BOOL
575576
If enabled, tools will be linked with the libLLVM shared library. Defaults
576577
to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB
577578
to ON.
579+
This option is not available on Windows.
578580

579581
**BUILD_SHARED_LIBS**:BOOL
580582
Flag indicating if each LLVM component (e.g. Support) is built as a shared

llvm/docs/GettingStarted.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ used by people developing LLVM.
622622
| | default set of LLVM components that can be |
623623
| | overridden with ``LLVM_DYLIB_COMPONENTS``. The |
624624
| | default contains most of LLVM and is defined in |
625-
| | ``tools/llvm-shlib/CMakelists.txt``. |
625+
| | ``tools/llvm-shlib/CMakelists.txt``. This option is|
626+
| | not avialable on Windows. |
626627
+-------------------------+----------------------------------------------------+
627628
| LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during |
628629
| | the LLVM build. This can dramatically speed up |

llvm/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ Non-comprehensive list of changes in this release
5858
* The BasicBlockPass, BBPassManager and all their uses were deleted in
5959
`this revision <https://reviews.llvm.org/rG9f0ff0b2634bab6a5be8dace005c9eb24d386dd1>`_.
6060

61+
* The LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB CMake options are no longer
62+
available on Windows.
63+
6164
.. NOTE
6265
If you would like to document a larger change, then you can add a
6366
subsection about it right here. You can copy the following boilerplate

0 commit comments

Comments
 (0)