Compare commits
2 Commits
9353d3dccc
...
7ddc6aad72
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ddc6aad72 | |||
| be611c26c8 |
@@ -20,17 +20,12 @@ if (ENABLE_ASAN)
|
|||||||
-fsanitize=undefined
|
-fsanitize=undefined
|
||||||
-fno-omit-frame-pointer
|
-fno-omit-frame-pointer
|
||||||
)
|
)
|
||||||
|
|
||||||
add_link_options(
|
|
||||||
-fsanitize=address
|
|
||||||
-fsanitize=undefined
|
|
||||||
)
|
|
||||||
message("asan is on. if have any problems, disable it.")
|
message("asan is on. if have any problems, disable it.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# For CURL
|
# For CURL
|
||||||
set(BUILD_STATIC_LIBS ON)
|
set(BUILD_STATIC_LIBS ON)
|
||||||
if(WIN32)
|
if (WIN32)
|
||||||
set(CURL_USE_SCHANNEL ON)
|
set(CURL_USE_SCHANNEL ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@@ -56,3 +51,18 @@ FetchContent_MakeAvailable(cJSON curl)
|
|||||||
add_executable(main main.c)
|
add_executable(main main.c)
|
||||||
target_include_directories(main PUBLIC ${cJSON_SOURCE_DIR})
|
target_include_directories(main PUBLIC ${cJSON_SOURCE_DIR})
|
||||||
target_link_libraries(main cjson-static libcurl_static pthread)
|
target_link_libraries(main cjson-static libcurl_static pthread)
|
||||||
|
|
||||||
|
if (ENABLE_ASAN)
|
||||||
|
target_link_options(
|
||||||
|
main BEFORE PUBLIC
|
||||||
|
-fsanitize=address
|
||||||
|
-fsanitize=undefined
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
target_link_options(
|
||||||
|
main BEFORE PUBLIC
|
||||||
|
-static
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
Reference in New Issue
Block a user