75 lines
1.7 KiB
CMake
75 lines
1.7 KiB
CMake
cmake_minimum_required(VERSION 3.30)
|
|
project(leetcode C CXX)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
include_directories(include)
|
|
|
|
include(FetchContent)
|
|
|
|
add_compile_options(
|
|
-Wall
|
|
-Wextra
|
|
-O0
|
|
-g3
|
|
-fno-omit-frame-pointer
|
|
)
|
|
|
|
if (UNIX)
|
|
add_compile_options(
|
|
-fsanitize=address
|
|
-fsanitize=undefined
|
|
)
|
|
add_link_options(
|
|
-fsanitize=address
|
|
-fsanitize=undefined
|
|
)
|
|
endif ()
|
|
|
|
FetchContent_Declare(
|
|
googletest
|
|
URL https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz
|
|
URL_HASH MD5=7e11f6cfcf6498324ac82d567dcb891e
|
|
)
|
|
|
|
FetchContent_MakeAvailable(googletest)
|
|
|
|
add_executable(13 src/13.c)
|
|
add_executable(88 src/88.c)
|
|
add_executable(100 src/100.c)
|
|
add_executable(101 src/101.c)
|
|
add_executable(104 src/104.c)
|
|
add_executable(108 src/108.c)
|
|
add_executable(110 src/110.c)
|
|
add_executable(111 src/111.c)
|
|
add_executable(112 src/119.c)
|
|
add_executable(136 src/136.c)
|
|
add_executable(141 src/141.c)
|
|
add_executable(144 src/144.c)
|
|
add_executable(145 src/145.c)
|
|
add_executable(160 src/160.c)
|
|
add_executable(168 src/168.c)
|
|
add_executable(169 src/169.c)
|
|
add_executable(171 src/171.c)
|
|
add_executable(190 src/190.c)
|
|
add_executable(191 src/191.c)
|
|
add_executable(202 src/202.c)
|
|
add_executable(219 src/219.c)
|
|
add_executable(225 src/225.c)
|
|
add_executable(228 src/228.c)
|
|
add_executable(231 src/231.c)
|
|
add_executable(258 src/258.c)
|
|
add_executable(263 src/263.c)
|
|
add_executable(268 src/268.c)
|
|
add_executable(278 src/278.c)
|
|
add_executable(338 src/338.c)
|
|
add_executable(374 src/374.c)
|
|
add_executable(2786 src/2786.c)
|
|
add_executable(3110 src/3110.c)
|
|
|
|
add_library(2711 STATIC src/2711.c)
|
|
|
|
add_subdirectory(tests)
|