Skip to content

Commit cb3e108

Browse files
committed
cmake: build shared lib on windows
1 parent b28cda4 commit cb3e108

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is just an orchestration
2-
cmake_minimum_required(VERSION 3.16..3.31)
2+
cmake_minimum_required(VERSION 3.24..3.31)
33
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
44

55
# Enable output of compile commands during generation.
@@ -54,8 +54,7 @@ if(UNIX)
5454
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OutputConfig}/${CMAKE_INSTALL_BINDIR})
5555
endforeach()
5656
else()
57-
# Currently Only support static build for windows
58-
option(BUILD_SHARED_LIBS "Build shared libraries (.dll)." OFF)
57+
option(BUILD_SHARED_LIBS "Build shared libraries (.dll)." ON)
5958
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
6059
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
6160
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
@@ -75,10 +74,7 @@ endif()
7574
# Enable CCache if any
7675
include(ccache)
7776

78-
# Disable CTest targets
79-
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
80-
include(CTest)
81-
77+
# Build deps
8278
option(BUILD_ZLIB "Build the ZLIB dependency Library" ON)
8379
message(STATUS "Build ZLIB: ${BUILD_ZLIB}")
8480

@@ -91,6 +87,10 @@ message(STATUS "Build re2: ${BUILD_re2}")
9187
option(BUILD_Protobuf "Build the Protobuf dependency Library" ON)
9288
message(STATUS "Build protobuf: ${BUILD_Protobuf}")
9389

90+
# Disable CTest targets
91+
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
92+
include(CTest)
93+
9494
if(BUILD_TESTING)
9595
option(BUILD_googletest "Build googletest" ON)
9696
option(BUILD_benchmark "Build benchmark" ON)

0 commit comments

Comments
 (0)