@@ -2,18 +2,14 @@ cmake_minimum_required (VERSION 3.13)
22
33### Basic compilation settings
44set (CMAKE_POSITION_INDEPENDENT_CODE TRUE )
5- add_definitions (-DNOMINMAX )
65
76include_directories (
87 ${CMAKE_CURRENT_SOURCE_DIR}
98 ${CMAKE_CURRENT_BINARY_DIR}
109)
1110
1211### Compiler-specific flags
13- if (MSVC )
14- set (DLLEXPORT "__declspec(dllexport)" )
15- elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
16- set (DLLEXPORT "__attribute__((visibility(\" default\" )))" )
12+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
1713 add_compile_options ("-fvisibility=hidden" )
1814 add_link_options ("-fvisibility=hidden" )
1915endif ()
@@ -24,6 +20,7 @@ add_library (https MODULE
2420)
2521
2622add_library (https-common STATIC
23+ common/HTTPS.cpp
2724 common/HTTPRequest.cpp
2825 common/HTTPSClient.cpp
2926 common/PlaintextConnection.cpp
@@ -95,22 +92,26 @@ include_directories (${LUA_INCLUDE_DIR})
9592target_link_libraries (https ${LUA_LIBRARIES} )
9693
9794if (USE_CURL_BACKEND)
95+ set (HTTPS_BACKEND_CURL ON )
9896 find_package (CURL REQUIRED )
9997 include_directories (${CURL_INCLUDE_DIR} )
10098 target_link_libraries (https https-curl ${CURL_LIBRARIES} )
10199endif ()
102100
103101if (USE_OPENSSL_BACKEND)
102+ set (HTTPS_BACKEND_OPENSSL ON )
104103 find_package (OpenSSL REQUIRED )
105104 include_directories (${OPENSSL_INCLUDE_DIR} )
106105 target_link_libraries (https https-openssl ${OPENSSL_LIBRARIES} )
107106endif ()
108107
109108if (USE_SCHANNEL_BACKEND)
109+ set (HTTPS_BACKEND_SCHANNEL ON )
110110 target_link_libraries (https https-schannel ws2_32 secur32 )
111111endif ()
112112
113113if (USE_NSURL_BACKEND)
114+ set (HTTPS_BACKEND_NSURL ON )
114115 set_target_properties (
115116 https-nsurl
116117 PROPERTIES
@@ -122,12 +123,14 @@ if (USE_NSURL_BACKEND)
122123endif ()
123124
124125if (USE_ANDROID_BACKEND)
126+ set (HTTPS_BACKEND_ANDROID ON )
125127 target_link_libraries (https https-android )
126128 message (STATUS "Ensure to add the Java files to your project too!" )
127129endif ()
128130
129- ### Generate config.h
131+ ### Generate config-generated.h
132+ add_compile_definitions (HTTPS_HAVE_CONFIG_GENERATED_H )
130133configure_file (
131- common/config.h.in
132- common/config.h
134+ common/config-generated .h.in
135+ common/config-generated .h
133136)
0 commit comments