-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 2.8)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
SET(CMAKE_CXX_FLAGS "-Ofast")
# Set SSL_ENABLED to OFF if you don't require https communication
SET(SSL_ENABLED OFF)
# If debugging is enabled in the mbedtls library, then enable debugging here
# ADD_DEFINITIONS (-DMBEDTLS_DEBUG="ON")
add_library(MacHTTP STATIC
HttpClient.h
HttpClient.cpp
HttpResponse.h
HttpResponse.cpp
Uri.h
Uri.cpp
http_parser.h
http_parser.c
yuarel.c
yuarel.h
)
IF(${SSL_ENABLED})
ADD_DEFINITIONS (-DSSL_ENABLED)
target_link_libraries(MacHTTP mbedtls mbedx509 mbedcrypto MacTCPHelper)
ELSE()
target_link_libraries(MacHTTP MacTCPHelper)
ENDIF()
# Some options to make things smaller
set_target_properties(MacHTTP PROPERTIES COMPILE_OPTIONS -ffunction-sections)
set_target_properties(MacHTTP PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
add_application(MacHTTPTest
MacHttpTest.cpp
size.r
CONSOLE
)
target_link_libraries(MacHTTPTest MacHTTP)
install(TARGETS MacHTTP
DESTINATION "lib"
)
install(FILES HttpClient.h HttpResponse.h Uri.h http_parser.h
DESTINATION "include/machttp"
)