LiveParise/CMakeLists.txt
2024-09-08 19:28:12 +08:00

47 lines
934 B
CMake

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)