This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ pre-package:
4040ifeq ($(OS ) ,Windows_NT)
4141 @powershell -Command "mkdir -p cortex-cpp;"
4242 @powershell -Command "cp build\cortex-cpp.exe .\cortex-cpp\;"
43- @powershell -Command "cp build-deps\_install\bin\zlib.dll .\cortex-cpp\;"
4443 @powershell -Command "cp ..\.github\patches\windows\msvcp140.dll .\cortex-cpp\;"
4544 @powershell -Command "cp ..\.github\patches\windows\vcruntime140_1.dll .\cortex-cpp\;"
4645 @powershell -Command "cp ..\.github\patches\windows\vcruntime140.dll .\cortex-cpp\;"
Original file line number Diff line number Diff line change @@ -19,20 +19,26 @@ set(THIRD_PARTY_INSTALL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../build-deps/_install)
1919#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
2020#
2121# Add the external project
22- set (ZLIB_USE_STATIC_LIBS OFF )
23- find_package (ZLIB)
24- if (NOT ZLIB_FOUND)
25- set (ZLIB_USE_STATIC_LIBS ON )
26- ExternalProject_Add(
27- zlib
22+ if (NOT APPLE )
23+ ExternalProject_Add(
24+ zlib
2825 GIT_REPOSITORY https://github.com/madler/zlib.git
2926 GIT_TAG v1.2.11
3027 CMAKE_ARGS
3128 -DBUILD_SHARED_LIBS=OFF
3229 -DCMAKE_INSTALL_PREFIX=${THIRD_PARTY_INSTALL_PATH}
3330 -DCMAKE_BUILD_TYPE=RELEASE
31+ )
32+
33+ if (WIN32 )
34+ SET (ZLIB_DYN_PATH "${THIRD_PARTY_INSTALL_PATH} /lib/zlib.lib" )
35+ ExternalProject_Add_Step(
36+ zlib remove_dynamic_lib
37+ COMMAND ${CMAKE_COMMAND} -E rm -f ${ZLIB_DYN_PATH}
38+ DEPENDEES install
3439 )
3540endif ()
41+ endif ()
3642
3743ExternalProject_Add(
3844 brotli
@@ -76,7 +82,6 @@ ExternalProject_Add(
7682 CMAKE_ARGS
7783 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
7884 -DOPENSSL_USE_STATIC_LIBS=TRUE
79- -DZLIB_USE_STATIC_LIBS=${ZLIB_USE_STATIC_LIBS}
8085 -DBUILD_ORM=OFF
8186 -DBUILD_YAML_CONFIG=OFF
8287 -DBUILD_EXAMPLES=OFF
@@ -116,8 +121,9 @@ link_directories(${THIRD_PARTY_INSTALL_PATH}/lib)
116121# Optionally link or add dependencies to your targets
117122add_dependencies (drogon c-ares jsoncpp brotli)
118123
119- if (ZLIB_USE_STATIC_LIBS )
124+ if (NOT APPLE )
120125 add_dependencies (drogon zlib)
121126endif ()
127+
122128# target_link_libraries(<your-target> ...)
123129
You can’t perform that action at this time.
0 commit comments