Skip to content

Commit c6347cb

Browse files
committed
cmake: do not install the static libraries by default
1 parent 9867af0 commit c6347cb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ option(USE_LTO "Enable link-time optimization" OFF)
7171
# See https://github.com/DaemonEngine/crunch/issues/29
7272
option(USE_FAST_MATH "Enable fast math (generated images are less likely to be reproducible)" OFF)
7373

74+
if (BUILD_STATIC_LIBCRN)
75+
option(INSTALL_STATIC_LIBS "Install static libraries" OFF)
76+
endif()
77+
7478
if (MSVC)
7579
# Enable MSVC parallel compilation.
7680
set_cxx_flag("/MP")

crnlib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ endif()
210210
add_library(${CRUNCH_LIBRARY_NAME} ${CRUNCH_DEFAULT_LIBRARY_TYPE} $<TARGET_OBJECTS:${CRUNCH_OBJECT_NAME}>)
211211
set_property(TARGET ${CRUNCH_LIBRARY_NAME} PROPERTY POSITION_INDEPENDENT_CODE 1)
212212

213-
if (BUILD_SHARED_LIBS OR BUILD_STATIC_LIBCRN)
213+
if (BUILD_SHARED_LIBS OR (BUILD_STATIC_LIBCRN AND INSTALL_STATIC_LIBS))
214214
install(TARGETS ${CRUNCH_LIBRARY_NAME} DESTINATION lib)
215215
endif()
216216

0 commit comments

Comments
 (0)