first commit

This commit is contained in:
2024-09-08 19:28:12 +08:00
commit 93cbf7c87b
7 changed files with 338 additions and 0 deletions

47
CMakeLists.txt Normal file
View File

@@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.30)
project(Live\ Parise C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(
-Wall
-Wextra
-O2
-g3
-fsanitize=address
-fsanitize=undefined
-fno-omit-frame-pointer
)
add_link_options(
-fsanitize=address
-fsanitize=undefined
)
include(FetchContent)
# For CURL
set(BUILD_STATIC_LIBS ON)
# For cJSON
set(BUILD_SHARED_AND_STATIC_LIBS ON)
set(ENABLE_CUSTOM_COMPILER_FLAGS OFF)
FetchContent_Declare(
cJSON
GIT_REPOSITORY https://github.com/DaveGamble/cJSON.git
GIT_TAG v1.7.18
)
FetchContent_Declare(
curl
GIT_REPOSITORY https://github.com/curl/curl.git
GIT_TAG curl-8_9_1
)
FetchContent_MakeAvailable(cJSON curl)
add_executable(main main.c)
target_include_directories(main PUBLIC ${cJSON_SOURCE_DIR})
target_link_libraries(main cjson libcurl)