-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
62 lines (49 loc) · 1.26 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
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required (VERSION 3.11)
project (cpp_examples CXX)
option(NATIVE "Enable native performance" ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -std=c++17")
function (create_program name)
add_executable(${name} ${ARGN})
set_target_properties(${name} PROPERTIES CXX_STANDARD 17)
if (NATIVE)
target_compile_options(${name} PRIVATE -march=skylake -O3 -fno-fast-math)
endif()
target_link_libraries(${name} -static)
endfunction()
add_subdirectory(ext/libdeflate)
add_subdirectory(simdjson)
add_subdirectory(ext/json)
add_subdirectory(ext/Turbo-Base64)
create_program(deflate
src/deflate.cpp
)
target_link_libraries(deflate libdeflate_static nlohmann_json)
create_program(espeak
src/espeak.cpp
)
target_link_libraries(espeak espeak-ng sonic)
create_program(hello_world
src/hello_world.cpp
)
create_program(hello_frontend
src/hello_frontend.cpp
)
create_program(minify
src/minify.cpp
)
target_link_libraries(minify simdjson)
create_program(basicauth
src/basicauth.cpp
)
target_link_libraries(basicauth base64)
create_program(fetch
src/fetch.cpp
)
target_link_libraries(fetch nlohmann_json)
create_program(to_string
src/to_string.cpp
)
create_program(payload
src/payload.cpp
)
target_link_libraries(payload nlohmann_json)