31 lines
537 B
CMake
31 lines
537 B
CMake
cmake_minimum_required(VERSION 3.30)
|
|
project(leetcode C)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
include_directories(include)
|
|
|
|
add_compile_options(
|
|
-Wall
|
|
-Wextra
|
|
-O0
|
|
-g3
|
|
-fsanitize=address
|
|
-fsanitize=undefined
|
|
-fno-omit-frame-pointer
|
|
)
|
|
|
|
add_link_options(
|
|
-fsanitize=address
|
|
-fsanitize=undefined
|
|
)
|
|
|
|
file(GLOB SRC_FILES "src/*.c")
|
|
|
|
foreach(SRC_FILE ${SRC_FILES})
|
|
get_filename_component(EXE_NAME ${SRC_FILE} NAME_WE)
|
|
add_executable(${EXE_NAME} ${SRC_FILE})
|
|
endforeach()
|
|
|