-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.01 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
cmake_minimum_required(VERSION 3.14)
project(waster LANGUAGES C)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
message(STATUS "Building in ${CMAKE_BUILD_TYPE} mode")
message(STATUS "Building with ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} on ${CMAKE_SYSTEM}")
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
list(APPEND waster_cflags -g -O0 -fno-omit-frame-pointer)
endif()
add_subdirectory(deps/quickjs-0.3.0 EXCLUDE_FROM_ALL)
option(libuv_buildtests "" OFF)
add_subdirectory(deps/libuv-1.47.0 EXCLUDE_FROM_ALL)
add_executable(waster
src/main.c
src/tcp-server.c
src/utils.c
)
set_target_properties(waster PROPERTIES
C_STANDARD 11
C_STANDARD_REQUIRED ON
)
target_compile_options(waster PRIVATE ${waster_cflags})
target_link_libraries(waster qjs uv_a)