-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (60 loc) · 2.02 KB
/
CMakeLists.txt
File metadata and controls
71 lines (60 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.20)
project(nano-agent VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Check if submodules are initialized
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/spdlog/CMakeLists.txt")
message(FATAL_ERROR "The spdlog submodule is missing! Please run: git submodule update --init --recursive")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/googletest/CMakeLists.txt")
message(FATAL_ERROR "The googletest submodule is missing! Please run: git submodule update --init --recursive")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rd-party/json/CMakeLists.txt")
message(FATAL_ERROR "The nlohmann/json submodule is missing! Please run: git submodule update --init --recursive")
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
option(ENABLE_ASAN "Enable AddressSanitizer" ON)
else()
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)
endif()
if(ENABLE_ASAN)
message(STATUS "AddressSanitizer is ENABLED")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
# Add submodules
add_subdirectory(3rd-party/spdlog)
add_subdirectory(3rd-party/googletest)
add_subdirectory(3rd-party/json)
find_package(CURL REQUIRED)
# Include directories
include_directories(include)
# Source files
set(SOURCES
src/main.cpp
src/cli.cpp
src/config.cpp
src/workspace.cpp
src/logger.cpp
src/http.cpp
src/llm.cpp
src/sse_parser.cpp
src/tool_call_assembler.cpp
src/tool_registry.cpp
src/write_file.cpp
src/read_file.cpp
src/bash_tool.cpp
src/build_test_tools.cpp
src/repo_tools.cpp
src/agent_utils.cpp
src/agent_tools.cpp
src/apply_patch.cpp
src/agent_loop.cpp
)
# Main executable
add_executable(agent ${SOURCES})
target_link_libraries(agent PRIVATE spdlog::spdlog CURL::libcurl nlohmann_json::nlohmann_json)
# Enable testing
enable_testing()
add_subdirectory(tests)