Skip to content

Commit

Permalink
Fixed openssl build defines
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Jun 7, 2023
1 parent 5a56bc8 commit 2649906
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = https://github.com/gabime/spdlog.git
[submodule "third_party/fastpbkdf2"]
path = third_party/fastpbkdf2
url = https://github.com/ctz/fastpbkdf2.git
url = https://github.com/danpashin/fastpbkdf2.git
[submodule "third_party/nlohmann"]
path = third_party/nlohmann
url = https://github.com/nlohmann/json.git
Expand Down
31 changes: 27 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,34 @@ endif(WIN32)

# Set sockettcp build flags
add_definitions(-DUSE_IPV6)
string(FIND "${OPENSSL_VERSION}" "1.1." SSL_VER_POS)

set(OPENSSL_VER "OPENSSL_API_${OPENSSL_VERSION_MAJOR}_${OPENSSL_VERSION_MINOR}")
message(STATUS "OPENSSL Version: ${OPENSSL_VER}")
add_definitions(-D${OPENSSL_VER})

# 1.1.0 / 1.1.1 / 3.0.0 / 3.1.0
string(FIND "${OPENSSL_VERSION}" "1.0" SSL_VER_POS)
if(${SSL_VER_POS})
add_definitions(-DOPENSSL_API_1_0)
else()
add_definitions(-DOPENSSL_API_1_1)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_API_1_0")
#add_definitions(-DOPENSSL_API_1_0)
endif()

string(FIND "${OPENSSL_VERSION}" "1.1" SSL_VER_POS)
if(${SSL_VER_POS})
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_API_1_1")
#add_definitions(-DOPENSSL_API_1_1)
endif()

string(FIND "${OPENSSL_VERSION}" "3.0" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
#add_definitions(-DOPENSSL_API_3_0)
message(STATUS "openssl test ${SSL_VER_POS}")
endif()

string(FIND "${OPENSSL_VERSION}" "3.1" SSL_VER_POS)
if(NOT SSL_VER_POS EQUAL -1)
add_definitions(-DOPENSSL_API_3_0)
message(STATUS "Open ssl version is 3.1 but set to 3.0 ${SSL_VER_POS} fir Civetweb. That is OK")
endif()

set(RESOURCE_FILES
Expand Down

0 comments on commit 2649906

Please sign in to comment.