cmake_minimum_required(VERSION 3.20)
project(WhetstoneEditor LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)

if(MSVC)
    add_compile_options(/FS /bigobj)
endif()

# Use vcpkg-installed nlohmann_json instead of FetchContent
find_package(nlohmann_json CONFIG REQUIRED)

# Tree-sitter core (from vcpkg)
find_package(unofficial-tree-sitter CONFIG REQUIRED)

# Tree-sitter grammar libraries (not available in vcpkg, fetched from GitHub)
include(FetchContent)

FetchContent_Declare(
    tree-sitter-python
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-python.git
    GIT_TAG        v0.23.6
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-cpp
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-cpp.git
    GIT_TAG        v0.23.4
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-elisp
    GIT_REPOSITORY https://github.com/Wilfred/tree-sitter-elisp.git
    GIT_TAG        1.3.0
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-javascript
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-javascript.git
    GIT_TAG        v0.23.1
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-typescript
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-typescript.git
    GIT_TAG        v0.23.2
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-java
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-java.git
    GIT_TAG        v0.23.5
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-rust
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-rust.git
    GIT_TAG        v0.23.3
    GIT_SHALLOW    TRUE
    SOURCE_DIR     ${CMAKE_BINARY_DIR}/_deps/tree-sitter-rust-src2
    BINARY_DIR     ${CMAKE_BINARY_DIR}/_deps/tree-sitter-rust-build2
)

FetchContent_Declare(
    tree-sitter-go
    GIT_REPOSITORY https://github.com/tree-sitter/tree-sitter-go.git
    GIT_TAG        v0.23.4
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tree-sitter-org
    GIT_REPOSITORY https://github.com/milisims/tree-sitter-org.git
    GIT_TAG        v1.3.1
    GIT_SHALLOW    TRUE
)

FetchContent_Declare(
    tinyfiledialogs
    GIT_REPOSITORY https://github.com/native-toolkit/tinyfiledialogs.git
    GIT_TAG        2.9.3
    GIT_SHALLOW    TRUE
)

# Populate without add_subdirectory (grammars have their own CMakeLists with conflicting targets)
FetchContent_GetProperties(tree-sitter-python)
if(NOT tree-sitter-python_POPULATED)
    FetchContent_Populate(tree-sitter-python)
endif()

FetchContent_GetProperties(tree-sitter-cpp)
if(NOT tree-sitter-cpp_POPULATED)
    FetchContent_Populate(tree-sitter-cpp)
endif()

FetchContent_GetProperties(tree-sitter-elisp)
if(NOT tree-sitter-elisp_POPULATED)
    FetchContent_Populate(tree-sitter-elisp)
endif()

FetchContent_GetProperties(tree-sitter-javascript)
if(NOT tree-sitter-javascript_POPULATED)
    FetchContent_Populate(tree-sitter-javascript)
endif()

FetchContent_GetProperties(tree-sitter-typescript)
if(NOT tree-sitter-typescript_POPULATED)
    FetchContent_Populate(tree-sitter-typescript)
endif()

FetchContent_GetProperties(tree-sitter-java)
if(NOT tree-sitter-java_POPULATED)
    FetchContent_Populate(tree-sitter-java)
endif()

FetchContent_GetProperties(tree-sitter-rust)
if(NOT tree-sitter-rust_POPULATED)
    FetchContent_Populate(tree-sitter-rust)
endif()

FetchContent_GetProperties(tree-sitter-go)
if(NOT tree-sitter-go_POPULATED)
    FetchContent_Populate(tree-sitter-go)
endif()

FetchContent_GetProperties(tree-sitter-org)
if(NOT tree-sitter-org_POPULATED)
    FetchContent_Populate(tree-sitter-org)
endif()

FetchContent_GetProperties(tinyfiledialogs)
if(NOT tinyfiledialogs_POPULATED)
    FetchContent_Populate(tinyfiledialogs)
endif()

# Build tree-sitter-python grammar as a static C library
add_library(tree_sitter_python STATIC
    ${tree-sitter-python_SOURCE_DIR}/src/parser.c
    ${tree-sitter-python_SOURCE_DIR}/src/scanner.c
)
target_include_directories(tree_sitter_python PUBLIC
    ${tree-sitter-python_SOURCE_DIR}/src
)
target_link_libraries(tree_sitter_python PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-cpp grammar as a static C library
# Note: tree-sitter-cpp scanner is C++ (.cc)
add_library(tree_sitter_cpp STATIC
    ${tree-sitter-cpp_SOURCE_DIR}/src/parser.c
    ${tree-sitter-cpp_SOURCE_DIR}/src/scanner.c
)
target_include_directories(tree_sitter_cpp PUBLIC
    ${tree-sitter-cpp_SOURCE_DIR}/src
)
target_link_libraries(tree_sitter_cpp PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-elisp grammar as a static C library
add_library(tree_sitter_elisp STATIC
    ${tree-sitter-elisp_SOURCE_DIR}/src/parser.c
)
target_include_directories(tree_sitter_elisp PUBLIC
    ${tree-sitter-elisp_SOURCE_DIR}/src
)
target_link_libraries(tree_sitter_elisp PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-javascript grammar as a static C library
set(_ts_js_src ${tree-sitter-javascript_SOURCE_DIR}/src/parser.c)
if(EXISTS "${tree-sitter-javascript_SOURCE_DIR}/src/scanner.c")
    list(APPEND _ts_js_src "${tree-sitter-javascript_SOURCE_DIR}/src/scanner.c")
endif()
add_library(tree_sitter_javascript STATIC ${_ts_js_src})
target_include_directories(tree_sitter_javascript PUBLIC ${tree-sitter-javascript_SOURCE_DIR}/src)
target_link_libraries(tree_sitter_javascript PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-typescript grammar as a static C library (typescript only)
set(_ts_ts_src ${tree-sitter-typescript_SOURCE_DIR}/typescript/src/parser.c)
if(EXISTS "${tree-sitter-typescript_SOURCE_DIR}/typescript/src/scanner.c")
    list(APPEND _ts_ts_src "${tree-sitter-typescript_SOURCE_DIR}/typescript/src/scanner.c")
endif()
add_library(tree_sitter_typescript STATIC ${_ts_ts_src})
target_include_directories(tree_sitter_typescript PUBLIC ${tree-sitter-typescript_SOURCE_DIR}/typescript/src)
target_link_libraries(tree_sitter_typescript PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-java grammar as a static C library
set(_ts_java_src ${tree-sitter-java_SOURCE_DIR}/src/parser.c)
if(EXISTS "${tree-sitter-java_SOURCE_DIR}/src/scanner.c")
    list(APPEND _ts_java_src "${tree-sitter-java_SOURCE_DIR}/src/scanner.c")
endif()
add_library(tree_sitter_java STATIC ${_ts_java_src})
target_include_directories(tree_sitter_java PUBLIC ${tree-sitter-java_SOURCE_DIR}/src)
target_link_libraries(tree_sitter_java PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-rust grammar as a static C library
set(_ts_rust_src ${tree-sitter-rust_SOURCE_DIR}/src/parser.c)
if(EXISTS "${tree-sitter-rust_SOURCE_DIR}/src/scanner.c")
    list(APPEND _ts_rust_src "${tree-sitter-rust_SOURCE_DIR}/src/scanner.c")
endif()
add_library(tree_sitter_rust STATIC ${_ts_rust_src})
target_include_directories(tree_sitter_rust PUBLIC ${tree-sitter-rust_SOURCE_DIR}/src)
target_link_libraries(tree_sitter_rust PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-go grammar as a static C library
set(_ts_go_src ${tree-sitter-go_SOURCE_DIR}/src/parser.c)
if(EXISTS "${tree-sitter-go_SOURCE_DIR}/src/scanner.c")
    list(APPEND _ts_go_src "${tree-sitter-go_SOURCE_DIR}/src/scanner.c")
endif()
add_library(tree_sitter_go STATIC ${_ts_go_src})
target_include_directories(tree_sitter_go PUBLIC ${tree-sitter-go_SOURCE_DIR}/src)
target_link_libraries(tree_sitter_go PUBLIC unofficial::tree-sitter::tree-sitter)

# Build tree-sitter-org grammar as a static C library
set(_ts_org_src ${tree-sitter-org_SOURCE_DIR}/src/parser.c)
if(EXISTS "${tree-sitter-org_SOURCE_DIR}/src/scanner.c")
    list(APPEND _ts_org_src "${tree-sitter-org_SOURCE_DIR}/src/scanner.c")
elseif(EXISTS "${tree-sitter-org_SOURCE_DIR}/src/scanner.cc")
    list(APPEND _ts_org_src "${tree-sitter-org_SOURCE_DIR}/src/scanner.cc")
endif()
add_library(tree_sitter_org STATIC ${_ts_org_src})
target_include_directories(tree_sitter_org PUBLIC ${tree-sitter-org_SOURCE_DIR}/src)
target_link_libraries(tree_sitter_org PUBLIC unofficial::tree-sitter::tree-sitter)

# tinyfiledialogs (single C file)
add_library(tinyfiledialogs STATIC ${tinyfiledialogs_SOURCE_DIR}/tinyfiledialogs.c)
target_include_directories(tinyfiledialogs PUBLIC ${tinyfiledialogs_SOURCE_DIR})

add_executable(step1_test tests/step1_test.cpp)
target_include_directories(step1_test PRIVATE src)

add_executable(step2_test tests/step2_test.cpp)
target_include_directories(step2_test PRIVATE src)

add_executable(step3_test tests/step3_test.cpp)
target_include_directories(step3_test PRIVATE src)

add_executable(step4_test tests/step4_test.cpp)
target_include_directories(step4_test PRIVATE src)

add_executable(step5_test tests/step5_test.cpp)
target_include_directories(step5_test PRIVATE src)
target_link_libraries(step5_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step6_test tests/step6_test.cpp)
target_include_directories(step6_test PRIVATE src)
target_link_libraries(step6_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step7_test tests/step7_test.cpp)
target_include_directories(step7_test PRIVATE src)

add_executable(step8_test tests/step8_test.cpp)
target_include_directories(step8_test PRIVATE src)

add_executable(step9_test tests/step9_test.cpp)
target_include_directories(step9_test PRIVATE src)

add_executable(step10_test tests/step10_test.cpp)
target_include_directories(step10_test PRIVATE src)

add_executable(step11_test tests/step11_test.cpp)
target_include_directories(step11_test PRIVATE src)

add_executable(step12_test tests/step12_test.cpp)
target_include_directories(step12_test PRIVATE src)

add_executable(step13_test tests/step13_test.cpp)
target_include_directories(step13_test PRIVATE src)

add_executable(step14_test tests/step14_test.cpp)
target_include_directories(step14_test PRIVATE src)

add_executable(step15_test tests/step15_test.cpp)
target_include_directories(step15_test PRIVATE src)

add_executable(step16_test tests/step16_test.cpp)
target_include_directories(step16_test PRIVATE src)

add_executable(step17_test tests/step17_test.cpp)
target_include_directories(step17_test PRIVATE src)

add_executable(step18_test tests/step18_test.cpp)
target_include_directories(step18_test PRIVATE src)

add_executable(step19_test tests/step19_test.cpp)
target_include_directories(step19_test PRIVATE src)

add_executable(step20_test tests/step20_test.cpp)
target_include_directories(step20_test PRIVATE src)

add_executable(step21_test tests/step21_test.cpp)
target_include_directories(step21_test PRIVATE src)

add_executable(step22_test tests/step22_test.cpp)
target_include_directories(step22_test PRIVATE src)

add_executable(step23_test tests/step23_test.cpp)
target_include_directories(step23_test PRIVATE src)

add_executable(step24_test tests/step24_test.cpp)
target_include_directories(step24_test PRIVATE src)

add_executable(step25_test tests/step25_test.cpp)
target_include_directories(step25_test PRIVATE src)

add_executable(step26_test tests/step26_test.cpp)
target_include_directories(step26_test PRIVATE src)

add_executable(step27_test tests/step27_test.cpp)
target_include_directories(step27_test PRIVATE src)

add_executable(step28_test tests/step28_test.cpp)
target_include_directories(step28_test PRIVATE src)

add_executable(step29_test tests/step29_test.cpp)
target_include_directories(step29_test PRIVATE src)

add_executable(step30_test tests/step30_test.cpp)
target_include_directories(step30_test PRIVATE src)

add_executable(step31_test tests/step31_test.cpp)
target_include_directories(step31_test PRIVATE src)

add_executable(step32_test tests/step32_test.cpp)
target_include_directories(step32_test PRIVATE src)

add_executable(step33_test tests/step33_test.cpp)
target_include_directories(step33_test PRIVATE src)

add_executable(step34_test tests/step34_test.cpp)
target_include_directories(step34_test PRIVATE src)

add_executable(step35_test tests/step35_test.cpp)
target_include_directories(step35_test PRIVATE src)

add_executable(step36_test tests/step36_test.cpp)
target_include_directories(step36_test PRIVATE src)

add_executable(step37_test tests/step37_test.cpp)
target_include_directories(step37_test PRIVATE src)

add_executable(step38_test tests/step38_test.cpp)
target_include_directories(step38_test PRIVATE src)

add_executable(step39_test tests/step39_test.cpp)
target_include_directories(step39_test PRIVATE src)

add_executable(step40_test tests/step40_test.cpp)
target_include_directories(step40_test PRIVATE src)

add_executable(step41_test tests/step41_test.cpp)
target_include_directories(step41_test PRIVATE src)

add_executable(step42_test tests/step42_test.cpp)
target_include_directories(step42_test PRIVATE src)

add_executable(step43_test tests/step43_test.cpp)
target_include_directories(step43_test PRIVATE src)

add_executable(step44_test tests/step44_test.cpp)
target_include_directories(step44_test PRIVATE src)

add_executable(step45_test tests/step45_test.cpp)
target_include_directories(step45_test PRIVATE src)
target_link_libraries(step45_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_python)

add_executable(step46_test tests/step46_test.cpp)
target_include_directories(step46_test PRIVATE src)
target_link_libraries(step46_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_cpp)

add_executable(step47_test tests/step47_test.cpp)
target_include_directories(step47_test PRIVATE src)
target_link_libraries(step47_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_elisp)

add_executable(step48_test tests/step48_test.cpp)
target_include_directories(step48_test PRIVATE src)
target_link_libraries(step48_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step49_test tests/step49_test.cpp)
target_include_directories(step49_test PRIVATE src)
target_link_libraries(step49_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step50_test tests/step50_test.cpp)
target_include_directories(step50_test PRIVATE src)
target_link_libraries(step50_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step51_test tests/step51_test.cpp)
target_include_directories(step51_test PRIVATE src)
target_link_libraries(step51_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step52_test tests/step52_test.cpp)
target_include_directories(step52_test PRIVATE src)
target_link_libraries(step52_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step53_test tests/step53_test.cpp)
target_include_directories(step53_test PRIVATE src)
target_link_libraries(step53_test PRIVATE unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step54_test tests/step54_test.cpp)
target_include_directories(step54_test PRIVATE src)

add_executable(step55_test tests/step55_test.cpp)
target_include_directories(step55_test PRIVATE src)

add_executable(step56_test tests/step56_test.cpp)
target_include_directories(step56_test PRIVATE src)

add_executable(step57_test tests/step57_test.cpp)
target_include_directories(step57_test PRIVATE src)

add_executable(step58_test tests/step58_test.cpp)
target_include_directories(step58_test PRIVATE src)

add_executable(step59_test tests/step59_test.cpp)
target_include_directories(step59_test PRIVATE src)
target_link_libraries(step59_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step60_test tests/step60_test.cpp)
target_include_directories(step60_test PRIVATE src)
target_link_libraries(step60_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step61_test tests/step61_test.cpp)
target_include_directories(step61_test PRIVATE src)

add_executable(step62_test tests/step62_test.cpp)
target_include_directories(step62_test PRIVATE src)

add_executable(step63_test tests/step63_test.cpp)
target_include_directories(step63_test PRIVATE src)

add_executable(step64_test tests/step64_test.cpp)
target_include_directories(step64_test PRIVATE src)

add_executable(step65_test tests/step65_test.cpp)
target_include_directories(step65_test PRIVATE src)

add_executable(step66_test tests/step66_test.cpp)
target_include_directories(step66_test PRIVATE src)

add_executable(step67_test tests/step67_test.cpp)
target_include_directories(step67_test PRIVATE src)

add_executable(step68_test tests/step68_test.cpp)
target_include_directories(step68_test PRIVATE src)

add_executable(step69_test tests/step69_test.cpp)
target_include_directories(step69_test PRIVATE src)

add_executable(step70_test tests/step70_test.cpp)
target_include_directories(step70_test PRIVATE src)

add_executable(step71_test tests/step71_test.cpp)
target_include_directories(step71_test PRIVATE src)

add_executable(step72_test tests/step72_test.cpp)
target_include_directories(step72_test PRIVATE src)
target_link_libraries(step72_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step73_test tests/step73_test.cpp)
target_include_directories(step73_test PRIVATE src)

add_executable(step74_test tests/step74_test.cpp)
target_include_directories(step74_test PRIVATE src)
target_link_libraries(step74_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step75_test tests/step75_test.cpp)
target_include_directories(step75_test PRIVATE src)

add_executable(step76_test tests/step76_test.cpp)
target_include_directories(step76_test PRIVATE src)

add_executable(step77_test tests/step77_test.cpp)
target_include_directories(step77_test PRIVATE src)
target_link_libraries(step77_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step78_test tests/step78_test.cpp)
target_include_directories(step78_test PRIVATE src)
target_link_libraries(step78_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step79_test tests/step79_test.cpp)
target_include_directories(step79_test PRIVATE src)
target_link_libraries(step79_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step80_test tests/step80_test.cpp)
target_include_directories(step80_test PRIVATE src)
target_link_libraries(step80_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step81_test tests/step81_test.cpp)
target_include_directories(step81_test PRIVATE src)
target_link_libraries(step81_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step82_test tests/step82_test.cpp)
target_include_directories(step82_test PRIVATE src)
target_link_libraries(step82_test PRIVATE
    imgui::imgui
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp)

add_executable(step83_test tests/step83_test.cpp)
target_include_directories(step83_test PRIVATE src)
target_link_libraries(step83_test PRIVATE unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step84_test tests/step84_test.cpp src/FileDialog.cpp)
target_include_directories(step84_test PRIVATE src)
target_link_libraries(step84_test PRIVATE tinyfiledialogs)

add_executable(step85_test tests/step85_test.cpp)
target_include_directories(step85_test PRIVATE src)

add_executable(step86_test tests/step86_test.cpp)
target_include_directories(step86_test PRIVATE src)

add_executable(step87_test tests/step87_test.cpp)
target_include_directories(step87_test PRIVATE src)

add_executable(step88_test tests/step88_test.cpp)
target_include_directories(step88_test PRIVATE src)

add_executable(step89_test tests/step89_test.cpp)
target_include_directories(step89_test PRIVATE src)

add_executable(step90_test tests/step90_test.cpp)
target_include_directories(step90_test PRIVATE src)
target_link_libraries(step90_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step91_test tests/step91_test.cpp)
target_include_directories(step91_test PRIVATE src)
target_link_libraries(step91_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step92_test tests/step92_test.cpp)
target_include_directories(step92_test PRIVATE src)
target_link_libraries(step92_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step93_test tests/step93_test.cpp)
target_include_directories(step93_test PRIVATE src)
target_link_libraries(step93_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step94_test tests/step94_test.cpp)
target_include_directories(step94_test PRIVATE src)
target_link_libraries(step94_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step94a_test tests/step94a_test.cpp)
target_include_directories(step94a_test PRIVATE src)
target_link_libraries(step94a_test PRIVATE nlohmann_json::nlohmann_json unofficial::tree-sitter::tree-sitter tree_sitter_python)

add_executable(step95_test tests/step95_test.cpp)
target_include_directories(step95_test PRIVATE src)
target_link_libraries(step95_test PRIVATE imgui::imgui unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step96_test tests/step96_test.cpp)
target_include_directories(step96_test PRIVATE src)
target_link_libraries(step96_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step97_test tests/step97_test.cpp)
target_include_directories(step97_test PRIVATE src)
target_link_libraries(step97_test PRIVATE imgui::imgui unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step98_test tests/step98_test.cpp)
target_include_directories(step98_test PRIVATE src)
target_link_libraries(step98_test PRIVATE imgui::imgui unofficial::tree-sitter::tree-sitter tree_sitter_python tree_sitter_cpp tree_sitter_elisp)

add_executable(step99_test tests/step99_test.cpp)
target_include_directories(step99_test PRIVATE src)
target_link_libraries(step99_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step100_test tests/step100_test.cpp)
target_include_directories(step100_test PRIVATE src)
target_link_libraries(step100_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step101_test tests/step101_test.cpp)
target_include_directories(step101_test PRIVATE src)
target_link_libraries(step101_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step102_test tests/step102_test.cpp)
target_include_directories(step102_test PRIVATE src)
target_link_libraries(step102_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step103_test tests/step103_test.cpp)
target_include_directories(step103_test PRIVATE src)
target_link_libraries(step103_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step104_test tests/step104_test.cpp)
target_include_directories(step104_test PRIVATE src)
target_link_libraries(step104_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step105_test tests/step105_test.cpp)
target_include_directories(step105_test PRIVATE src)
target_link_libraries(step105_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step106_test tests/step106_test.cpp)
target_include_directories(step106_test PRIVATE src)
target_link_libraries(step106_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step107_test tests/step107_test.cpp)
target_include_directories(step107_test PRIVATE src)
target_link_libraries(step107_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step107a_test tests/step107a_test.cpp)
target_include_directories(step107a_test PRIVATE src)
target_link_libraries(step107a_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step107b_test tests/step107b_test.cpp)
target_include_directories(step107b_test PRIVATE src)
target_link_libraries(step107b_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step107c_test tests/step107c_test.cpp)
target_include_directories(step107c_test PRIVATE src)
target_link_libraries(step107c_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step108_test tests/step108_test.cpp)
target_include_directories(step108_test PRIVATE src)
target_link_libraries(step108_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step109_test tests/step109_test.cpp)
target_include_directories(step109_test PRIVATE src)
target_link_libraries(step109_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step110_test tests/step110_test.cpp)
target_include_directories(step110_test PRIVATE src)
target_link_libraries(step110_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step111_test tests/step111_test.cpp)
target_include_directories(step111_test PRIVATE src)
target_link_libraries(step111_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step112_test tests/step112_test.cpp)
target_include_directories(step112_test PRIVATE src)
target_link_libraries(step112_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step113_test tests/step113_test.cpp)
target_include_directories(step113_test PRIVATE src)
target_link_libraries(step113_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step114_test tests/step114_test.cpp)
target_include_directories(step114_test PRIVATE src)
target_link_libraries(step114_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step115_test tests/step115_test.cpp)
target_include_directories(step115_test PRIVATE src)
target_link_libraries(step115_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step116_test tests/step116_test.cpp)
target_include_directories(step116_test PRIVATE src)
target_link_libraries(step116_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step117_test tests/step117_test.cpp)
target_include_directories(step117_test PRIVATE src)
target_link_libraries(step117_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step118_test tests/step118_test.cpp)
target_include_directories(step118_test PRIVATE src)
target_link_libraries(step118_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step119_test tests/step119_test.cpp)
target_include_directories(step119_test PRIVATE src)
target_link_libraries(step119_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step120_test tests/step120_test.cpp)
target_include_directories(step120_test PRIVATE src)
target_link_libraries(step120_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step121_test tests/step121_test.cpp)
target_include_directories(step121_test PRIVATE src)
target_link_libraries(step121_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step122_test tests/step122_test.cpp)
target_include_directories(step122_test PRIVATE src)
target_link_libraries(step122_test PRIVATE imgui::imgui)

add_executable(step123_test tests/step123_test.cpp)
target_include_directories(step123_test PRIVATE src)
target_link_libraries(step123_test PRIVATE imgui::imgui)

add_executable(step124_test tests/step124_test.cpp)
target_include_directories(step124_test PRIVATE src)
target_link_libraries(step124_test PRIVATE
    nlohmann_json::nlohmann_json)

add_executable(step125_test tests/step125_test.cpp)
target_include_directories(step125_test PRIVATE src)
target_link_libraries(step125_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step125_integration_test tests/step125_integration_test.cpp)
target_include_directories(step125_integration_test PRIVATE src)
target_link_libraries(step125_integration_test PRIVATE
    imgui::imgui
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_rust
    tree_sitter_go
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_org)

add_executable(step126_test tests/step126_test.cpp)
target_include_directories(step126_test PRIVATE src)
target_link_libraries(step126_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step127_test tests/step127_test.cpp)
target_include_directories(step127_test PRIVATE src)
target_link_libraries(step127_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step128_test tests/step128_test.cpp)
target_include_directories(step128_test PRIVATE src)
target_link_libraries(step128_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step129_test tests/step129_test.cpp)
target_include_directories(step129_test PRIVATE src)
target_link_libraries(step129_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui)

add_executable(step130_test tests/step130_test.cpp)
target_include_directories(step130_test PRIVATE src)
target_link_libraries(step130_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step131_test tests/step131_test.cpp)
target_include_directories(step131_test PRIVATE src)
target_link_libraries(step131_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step132_test tests/step132_test.cpp)
target_include_directories(step132_test PRIVATE src)
target_link_libraries(step132_test PRIVATE
    imgui::imgui
    nlohmann_json::nlohmann_json)

add_executable(step133_test tests/step133_test.cpp)
target_include_directories(step133_test PRIVATE src)
target_link_libraries(step133_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step134_test tests/step134_test.cpp)
target_include_directories(step134_test PRIVATE src)
target_link_libraries(step134_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step135_test tests/step135_test.cpp)
target_include_directories(step135_test PRIVATE src)
target_link_libraries(step135_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step136_test tests/step136_test.cpp)
target_include_directories(step136_test PRIVATE src)
target_link_libraries(step136_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step137_test tests/step137_test.cpp)
target_include_directories(step137_test PRIVATE src)
target_link_libraries(step137_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step138_test tests/step138_test.cpp)
target_include_directories(step138_test PRIVATE src)
target_link_libraries(step138_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step139_test tests/step139_test.cpp)
target_include_directories(step139_test PRIVATE src)
target_link_libraries(step139_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step140_test tests/step140_test.cpp)
target_include_directories(step140_test PRIVATE src)
target_link_libraries(step140_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step141_test tests/step141_test.cpp)
target_include_directories(step141_test PRIVATE src)
target_link_libraries(step141_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step142_test tests/step142_test.cpp)
target_include_directories(step142_test PRIVATE src)
target_link_libraries(step142_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui)

add_executable(step143_test tests/step143_test.cpp)
target_include_directories(step143_test PRIVATE src)
target_link_libraries(step143_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui)

add_executable(step144_test tests/step144_test.cpp)
target_include_directories(step144_test PRIVATE src)
target_link_libraries(step144_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui)

add_executable(step145_test tests/step145_test.cpp)
target_include_directories(step145_test PRIVATE src)
target_link_libraries(step145_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui tree_sitter_org)

add_executable(step146_test tests/step146_test.cpp)
target_include_directories(step146_test PRIVATE src)
target_link_libraries(step146_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step147_test tests/step147_test.cpp)
target_include_directories(step147_test PRIVATE src)
target_link_libraries(step147_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_javascript
    tree_sitter_typescript)

add_executable(step148_test tests/step148_test.cpp)
target_include_directories(step148_test PRIVATE src)
target_link_libraries(step148_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step149_test tests/step149_test.cpp)
target_include_directories(step149_test PRIVATE src)
target_link_libraries(step149_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_java)

add_executable(step150_test tests/step150_test.cpp)
target_include_directories(step150_test PRIVATE src)
target_link_libraries(step150_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_rust)

add_executable(step151_test tests/step151_test.cpp)
target_include_directories(step151_test PRIVATE src)
target_link_libraries(step151_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_go)

add_executable(step152_test tests/step152_test.cpp)
target_include_directories(step152_test PRIVATE src)

add_executable(step153_test tests/step153_test.cpp)
target_include_directories(step153_test PRIVATE src)
target_link_libraries(step153_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step154_test tests/step154_test.cpp)
target_include_directories(step154_test PRIVATE src)
target_link_libraries(step154_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step155_test tests/step155_test.cpp)
target_include_directories(step155_test PRIVATE src)
target_link_libraries(step155_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step156_test tests/step156_test.cpp)
target_include_directories(step156_test PRIVATE src)

add_executable(step157_test tests/step157_test.cpp)
target_include_directories(step157_test PRIVATE src)

add_executable(step158_test tests/step158_test.cpp)
target_include_directories(step158_test PRIVATE src)
target_link_libraries(step158_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step159_test tests/step159_test.cpp)
target_include_directories(step159_test PRIVATE src)
target_link_libraries(step159_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step160_test tests/step160_test.cpp)
target_include_directories(step160_test PRIVATE src)
target_link_libraries(step160_test PRIVATE nlohmann_json::nlohmann_json imgui::imgui)

add_executable(step161_test tests/step161_test.cpp)
target_include_directories(step161_test PRIVATE src)

add_executable(step162_test tests/step162_test.cpp)
target_include_directories(step162_test PRIVATE src)
target_link_libraries(step162_test PRIVATE imgui::imgui)

add_executable(step163_test tests/step163_test.cpp)
target_include_directories(step163_test PRIVATE src)
target_link_libraries(step163_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step164_test tests/step164_test.cpp)
target_include_directories(step164_test PRIVATE src)
target_link_libraries(step164_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step165_test tests/step165_test.cpp)
target_include_directories(step165_test PRIVATE src)
target_link_libraries(step165_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(file_limits_test tests/file_limits_test.cpp)
target_include_directories(file_limits_test PRIVATE src)

add_executable(step166_test tests/step166_test.cpp)
target_include_directories(step166_test PRIVATE src)
target_link_libraries(step166_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step167_test tests/step167_test.cpp)
target_include_directories(step167_test PRIVATE src)
target_link_libraries(step167_test PRIVATE
    nlohmann_json::nlohmann_json)

add_executable(step168_test tests/step168_test.cpp)
target_include_directories(step168_test PRIVATE src)

add_executable(step168_integration_test tests/step168_integration_test.cpp)
target_include_directories(step168_integration_test PRIVATE src)
target_link_libraries(step168_integration_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step169_test tests/step169_test.cpp)
target_include_directories(step169_test PRIVATE src)
target_link_libraries(step169_test PRIVATE imgui::imgui)

add_executable(step169_integration_test tests/step169_integration_test.cpp)
target_include_directories(step169_integration_test PRIVATE src)
target_link_libraries(step169_integration_test PRIVATE imgui::imgui)

add_executable(step170_test tests/step170_test.cpp)
target_include_directories(step170_test PRIVATE src)

add_executable(step170_integration_test tests/step170_integration_test.cpp)
target_include_directories(step170_integration_test PRIVATE src)

add_executable(step171_test tests/step171_test.cpp)
target_include_directories(step171_test PRIVATE src)
target_link_libraries(step171_test PRIVATE imgui::imgui)

add_executable(step171_integration_test tests/step171_integration_test.cpp)
target_include_directories(step171_integration_test PRIVATE src)

add_executable(step172_test tests/step172_test.cpp)
target_include_directories(step172_test PRIVATE src)

add_executable(step172_integration_test tests/step172_integration_test.cpp)
target_include_directories(step172_integration_test PRIVATE src)
target_link_libraries(step172_integration_test PRIVATE imgui::imgui)

add_executable(step173_test tests/step173_test.cpp)
target_include_directories(step173_test PRIVATE src)

add_executable(step173_integration_test tests/step173_integration_test.cpp)
target_include_directories(step173_integration_test PRIVATE src)
target_link_libraries(step173_integration_test PRIVATE imgui::imgui)

add_executable(step174_test tests/step174_test.cpp)
target_include_directories(step174_test PRIVATE src)

add_executable(step174_integration_test tests/step174_integration_test.cpp)
target_include_directories(step174_integration_test PRIVATE src)
target_link_libraries(step174_integration_test PRIVATE imgui::imgui)

add_executable(step175_test tests/step175_test.cpp)
target_include_directories(step175_test PRIVATE src)

add_executable(step175_integration_test tests/step175_integration_test.cpp)
target_include_directories(step175_integration_test PRIVATE src)
target_link_libraries(step175_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step176_test tests/step176_test.cpp)
target_include_directories(step176_test PRIVATE src)

add_executable(step176_integration_test tests/step176_integration_test.cpp)
target_include_directories(step176_integration_test PRIVATE src)
target_link_libraries(step176_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step177_test tests/step177_test.cpp)
target_include_directories(step177_test PRIVATE src)

add_executable(step177_integration_test tests/step177_integration_test.cpp)
target_include_directories(step177_integration_test PRIVATE src)
target_link_libraries(step177_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step178_test tests/step178_test.cpp)
target_include_directories(step178_test PRIVATE src)

add_executable(step178_integration_test tests/step178_integration_test.cpp)
target_include_directories(step178_integration_test PRIVATE src)
target_link_libraries(step178_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step179_test tests/step179_test.cpp)
target_include_directories(step179_test PRIVATE src)

add_executable(step179_integration_test tests/step179_integration_test.cpp)
target_include_directories(step179_integration_test PRIVATE src)
target_link_libraries(step179_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step180_test tests/step180_test.cpp)
target_include_directories(step180_test PRIVATE src)

add_executable(step180_integration_test tests/step180_integration_test.cpp)
target_include_directories(step180_integration_test PRIVATE src)
target_link_libraries(step180_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step181_test tests/step181_test.cpp)
target_include_directories(step181_test PRIVATE src)

add_executable(step181_integration_test tests/step181_integration_test.cpp)
target_include_directories(step181_integration_test PRIVATE src)
target_link_libraries(step181_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step182_test tests/step182_test.cpp)
target_include_directories(step182_test PRIVATE src)

add_executable(step182_integration_test tests/step182_integration_test.cpp)
target_include_directories(step182_integration_test PRIVATE src)
target_link_libraries(step182_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step183_test tests/step183_test.cpp)
target_include_directories(step183_test PRIVATE src)

add_executable(step183_integration_test tests/step183_integration_test.cpp)
target_include_directories(step183_integration_test PRIVATE src)
target_link_libraries(step183_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step184_test tests/step184_test.cpp)
target_include_directories(step184_test PRIVATE src)

add_executable(step184_integration_test tests/step184_integration_test.cpp)
target_include_directories(step184_integration_test PRIVATE src)
target_link_libraries(step184_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step185_test tests/step185_test.cpp)
target_include_directories(step185_test PRIVATE src)

add_executable(step185_integration_test tests/step185_integration_test.cpp)
target_include_directories(step185_integration_test PRIVATE src)
target_link_libraries(step185_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step186_test tests/step186_test.cpp)
target_include_directories(step186_test PRIVATE src)

add_executable(step186_integration_test tests/step186_integration_test.cpp)
target_include_directories(step186_integration_test PRIVATE src)
target_link_libraries(step186_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step187_test tests/step187_test.cpp)
target_include_directories(step187_test PRIVATE src)

add_executable(step187_integration_test tests/step187_integration_test.cpp)
target_include_directories(step187_integration_test PRIVATE src)
target_link_libraries(step187_integration_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step188_test tests/step188_test.cpp)
target_include_directories(step188_test PRIVATE src)

add_executable(step189_test tests/step189_test.cpp)
target_include_directories(step189_test PRIVATE src)

add_executable(step190_test tests/step190_test.cpp)
target_include_directories(step190_test PRIVATE src)
target_link_libraries(step190_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step191_test tests/step191_test.cpp)
target_include_directories(step191_test PRIVATE src)

add_executable(step192_test tests/step192_test.cpp)
target_include_directories(step192_test PRIVATE src)

add_executable(step193_test tests/step193_test.cpp)
target_include_directories(step193_test PRIVATE src)

add_executable(step194_test tests/step194_test.cpp)
target_include_directories(step194_test PRIVATE src)

add_executable(step195_test tests/step195_test.cpp)
target_include_directories(step195_test PRIVATE src)

add_executable(step196_test tests/step196_test.cpp)
target_include_directories(step196_test PRIVATE src)

add_executable(step197_test tests/step197_test.cpp)
target_include_directories(step197_test PRIVATE src)

add_executable(step198_test tests/step198_test.cpp)
target_include_directories(step198_test PRIVATE src)

add_executable(step199_test tests/step199_test.cpp)
target_include_directories(step199_test PRIVATE src)

add_executable(step200_test tests/step200_test.cpp)
target_include_directories(step200_test PRIVATE src)

add_executable(step201_test tests/step201_test.cpp)
target_include_directories(step201_test PRIVATE src)

add_executable(step220_test tests/step220_test.cpp)
target_include_directories(step220_test PRIVATE src)

add_executable(step221_test tests/step221_test.cpp)
target_include_directories(step221_test PRIVATE src)

add_executable(step222_test tests/step222_test.cpp)
target_include_directories(step222_test PRIVATE src)

add_executable(step223_test tests/step223_test.cpp)
target_include_directories(step223_test PRIVATE src)

add_executable(step224_test tests/step224_test.cpp)
target_include_directories(step224_test PRIVATE src)
target_link_libraries(step224_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step225_test tests/step225_test.cpp)
target_include_directories(step225_test PRIVATE src)

add_executable(step226_test tests/step226_test.cpp)
target_include_directories(step226_test PRIVATE src)
add_executable(step227_test tests/step227_test.cpp)
target_include_directories(step227_test PRIVATE src)
add_executable(step228_test tests/step228_test.cpp)
target_include_directories(step228_test PRIVATE src)
target_link_libraries(step228_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step229_test tests/step229_test.cpp)
target_include_directories(step229_test PRIVATE src)
target_link_libraries(step229_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step230_test tests/step230_test.cpp)
target_include_directories(step230_test PRIVATE src)
target_link_libraries(step230_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step231_test tests/step231_test.cpp)
target_include_directories(step231_test PRIVATE src)
target_link_libraries(step231_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step232_test tests/step232_test.cpp)
target_include_directories(step232_test PRIVATE src)
target_link_libraries(step232_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step233_test tests/step233_test.cpp)
target_include_directories(step233_test PRIVATE src)
target_link_libraries(step233_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step234_test tests/step234_test.cpp)
target_include_directories(step234_test PRIVATE src)
target_link_libraries(step234_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step244_test tests/step244_test.cpp)
target_include_directories(step244_test PRIVATE src)
target_link_libraries(step244_test PRIVATE nlohmann_json::nlohmann_json)
add_executable(step213_test tests/step213_test.cpp)
target_include_directories(step213_test PRIVATE src)
target_link_libraries(step213_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step219_test tests/step219_test.cpp)
target_include_directories(step219_test PRIVATE src)
target_link_libraries(step219_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(step206_test tests/step206_test.cpp)
target_include_directories(step206_test PRIVATE src)
target_link_libraries(step206_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

if(UNIX AND NOT APPLE)
    # Force system SDL2 on Linux. The vcpkg toolchain overrides PKG_CONFIG_PATH,
    # causing pkg_check_modules to find vcpkg's headless (offscreen-only) SDL2.
    # We bypass that by pointing pkg-config directly at the system .pc files.
    find_package(PkgConfig REQUIRED)
    set(_saved_pkg_config_path "$ENV{PKG_CONFIG_PATH}")
    set(ENV{PKG_CONFIG_PATH} "/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
    pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
    set(ENV{PKG_CONFIG_PATH} "${_saved_pkg_config_path}")
    add_library(SDL2::SDL2 INTERFACE IMPORTED)
    target_link_libraries(SDL2::SDL2 INTERFACE PkgConfig::SDL2)
else()
    find_package(SDL2 CONFIG REQUIRED)
endif()
find_package(OpenGL REQUIRED)
find_package(glad CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)

# imgui SDL2 backend: vcpkg removed the sdl2-binding feature in imgui 1.91+.
# We compile the backend sources directly from imgui's source tree.
set(IMGUI_BACKENDS_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
set(IMGUI_SDL2_BACKEND "")
if(EXISTS "${IMGUI_BACKENDS_DIR}/imgui_impl_sdl2.h")
    # vcpkg installed the SDL2 backend (older vcpkg or feature restored)
    message(STATUS "Using vcpkg-installed imgui SDL2 backend")
else()
    # Compile SDL2 backend from imgui source (shipped in backends/ of the port)
    file(GLOB _imgui_sdl2_src
        "${_VCPKG_INSTALLED_DIR}/../buildtrees/imgui/src/*/backends/imgui_impl_sdl2.cpp"
    )
    if(NOT _imgui_sdl2_src)
        # Fallback: look for the backend in a local copy
        if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/imgui_backends/imgui_impl_sdl2.cpp")
            set(_imgui_sdl2_src "${CMAKE_CURRENT_SOURCE_DIR}/src/imgui_backends/imgui_impl_sdl2.cpp")
        endif()
    endif()
    if(_imgui_sdl2_src)
        list(GET _imgui_sdl2_src 0 _imgui_sdl2_src)
        get_filename_component(_imgui_sdl2_dir "${_imgui_sdl2_src}" DIRECTORY)
        message(STATUS "Compiling imgui SDL2 backend from: ${_imgui_sdl2_dir}")
        set(IMGUI_SDL2_BACKEND "${_imgui_sdl2_src}")
    else()
        message(WARNING "imgui SDL2 backend not found. Editor will not compile. "
            "Copy imgui_impl_sdl2.cpp/.h into editor/src/imgui_backends/")
    endif()
endif()

add_executable(whetstone_editor src/main.cpp src/FileDialog.cpp ${IMGUI_SDL2_BACKEND})
target_include_directories(whetstone_editor PRIVATE
    src
    ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/imgui
    ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include
)
target_compile_definitions(whetstone_editor PRIVATE WHETSTONE_ENABLE_ORG=1)
if(IMGUI_SDL2_BACKEND)
    get_filename_component(_sdl2_backend_dir "${IMGUI_SDL2_BACKEND}" DIRECTORY)
    target_include_directories(whetstone_editor PRIVATE "${_sdl2_backend_dir}")
endif()
target_link_libraries(whetstone_editor PRIVATE
    SDL2::SDL2
    $<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
    OpenGL::GL
    glad::glad
    imgui::imgui
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go
    tree_sitter_org)
target_link_libraries(whetstone_editor PRIVATE tinyfiledialogs)

add_executable(orchestrator src/orchestrator_main.cpp)
target_include_directories(orchestrator PRIVATE src)
target_link_libraries(orchestrator PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go)

add_executable(whetstone_eval src/eval_main.cpp)
target_include_directories(whetstone_eval PRIVATE src)
target_link_libraries(whetstone_eval PRIVATE nlohmann_json::nlohmann_json)

add_executable(whetstone_pipeline src/pipeline_main.cpp)
target_include_directories(whetstone_pipeline PRIVATE src)
target_link_libraries(whetstone_pipeline PRIVATE nlohmann_json::nlohmann_json)

# Step 245: Headless EditorState test (no SDL/ImGui dependency)
add_executable(step245_test tests/step245_test.cpp)
target_include_directories(step245_test PRIVATE src)
target_link_libraries(step245_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_cpp
    tree_sitter_elisp
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_java
    tree_sitter_rust
    tree_sitter_go
    tree_sitter_org)

# Step 246: Standalone MCP server (no SDL/ImGui)
add_executable(whetstone_mcp src/mcp_main.cpp)
target_include_directories(whetstone_mcp PRIVATE src)
target_link_libraries(whetstone_mcp PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

add_executable(step246_test tests/step246_test.cpp)
target_include_directories(step246_test PRIVATE src)
target_link_libraries(step246_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 247: File operation tools for MCP
add_executable(step247_test tests/step247_test.cpp)
target_include_directories(step247_test PRIVATE src)
target_link_libraries(step247_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 248: Compact AST response format
add_executable(step248_test tests/step248_test.cpp)
target_include_directories(step248_test PRIVATE src)
target_link_libraries(step248_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 249: MCP server integration tests
add_executable(step249_test tests/step249_test.cpp)
target_include_directories(step249_test PRIVATE src)
target_link_libraries(step249_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 250: Structured diagnostic format
add_executable(step250_test tests/step250_test.cpp)
target_include_directories(step250_test PRIVATE src)
target_link_libraries(step250_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 251: Quick-fix actions as RPC mutations
add_executable(step251_test tests/step251_test.cpp)
target_include_directories(step251_test PRIVATE src)
target_link_libraries(step251_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 252: Diagnostic delta streaming
add_executable(step252_test tests/step252_test.cpp)
target_include_directories(step252_test PRIVATE src)
target_link_libraries(step252_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 253: Diagnostic and delta integration tests
add_executable(step253_test tests/step253_test.cpp)
target_include_directories(step253_test PRIVATE src)
target_link_libraries(step253_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 254: Response budget system
add_executable(step254_test tests/step254_test.cpp)
target_include_directories(step254_test PRIVATE src)
target_link_libraries(step254_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

add_executable(step255_test tests/step255_test.cpp)
target_include_directories(step255_test PRIVATE src)
target_link_libraries(step255_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

add_executable(step256_test tests/step256_test.cpp)
target_include_directories(step256_test PRIVATE src)
target_link_libraries(step256_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 257: Token efficiency tests + benchmarks
add_executable(step257_test tests/step257_test.cpp)
target_include_directories(step257_test PRIVATE src)
target_link_libraries(step257_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 258: Project model and workspace indexing
add_executable(step258_test tests/step258_test.cpp)
target_include_directories(step258_test PRIVATE src)
target_link_libraries(step258_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 259: Cross-file symbol resolution
add_executable(step259_test tests/step259_test.cpp)
target_include_directories(step259_test PRIVATE src)
target_link_libraries(step259_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 260: Project-wide diagnostics
add_executable(step260_test tests/step260_test.cpp)
target_include_directories(step260_test PRIVATE src)
target_link_libraries(step260_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 261: Project-wide search and refactor
add_executable(step261_test tests/step261_test.cpp)
target_include_directories(step261_test PRIVATE src)
target_link_libraries(step261_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 262: Phase 9d multi-file project integration tests
add_executable(step262_test tests/step262_test.cpp)
target_include_directories(step262_test PRIVATE src)
target_link_libraries(step262_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 263: Save buffer to disk
add_executable(step263_test tests/step263_test.cpp)
target_include_directories(step263_test PRIVATE src)
target_link_libraries(step263_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 264: Undo/redo for headless mode
add_executable(step264_test tests/step264_test.cpp)
target_include_directories(step264_test PRIVATE src)
target_link_libraries(step264_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

add_executable(step265_test tests/step265_test.cpp)
target_include_directories(step265_test PRIVATE src)
target_link_libraries(step265_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

add_executable(step266_test tests/step266_test.cpp)
target_include_directories(step266_test PRIVATE src)
target_link_libraries(step266_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 267: Sidecar AST persistence
add_executable(step267_test tests/step267_test.cpp)
target_include_directories(step267_test PRIVATE src)
target_link_libraries(step267_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 270: Annotation prompt templates
add_executable(step270_test tests/step270_test.cpp)
target_include_directories(step270_test PRIVATE src)
target_link_libraries(step270_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 269: Annotation RPC methods
add_executable(step269_test tests/step269_test.cpp)
target_include_directories(step269_test PRIVATE src)
target_link_libraries(step269_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 268: Phase 10a integration tests
add_executable(step268_test tests/step268_test.cpp)
target_include_directories(step268_test PRIVATE src)
target_link_libraries(step268_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 271: Phase 10b integration tests
add_executable(step271_test tests/step271_test.cpp)
target_include_directories(step271_test PRIVATE src)
target_link_libraries(step271_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 272: Type System — Layout & Constraints
add_executable(step272_test tests/step272_test.cpp)
target_include_directories(step272_test PRIVATE src)
target_link_libraries(step272_test PRIVATE nlohmann_json::nlohmann_json)

# Step 273: Type System — Identity & Mutability
add_executable(step273_test tests/step273_test.cpp)
target_include_directories(step273_test PRIVATE src)
target_link_libraries(step273_test PRIVATE nlohmann_json::nlohmann_json)

# Step 274: Concurrency — Primitives & Memory Model
add_executable(step274_test tests/step274_test.cpp)
target_include_directories(step274_test PRIVATE src)
target_link_libraries(step274_test PRIVATE nlohmann_json::nlohmann_json)

# Step 275: Async, Parallelism & Error Handling
add_executable(step275_test tests/step275_test.cpp)
target_include_directories(step275_test PRIVATE src)
target_link_libraries(step275_test PRIVATE nlohmann_json::nlohmann_json)

# Step 276: Scope & Namespace Annotations
add_executable(step276_test tests/step276_test.cpp)
target_include_directories(step276_test PRIVATE src)
target_link_libraries(step276_test PRIVATE nlohmann_json::nlohmann_json)

# Step 277: Phase 10c Integration Tests
add_executable(step277_test tests/step277_test.cpp)
target_include_directories(step277_test PRIVATE src)
target_link_libraries(step277_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 278: Shim & Escape Hatch Annotations
add_executable(step278_test tests/step278_test.cpp)
target_include_directories(step278_test PRIVATE src)
target_link_libraries(step278_test PRIVATE nlohmann_json::nlohmann_json)

# Step 279: Platform & Provenance Annotations
add_executable(step279_test tests/step279_test.cpp)
target_include_directories(step279_test PRIVATE src)
target_link_libraries(step279_test PRIVATE nlohmann_json::nlohmann_json)

# Step 280: Optimization Annotation Completion
add_executable(step280_test tests/step280_test.cpp)
target_include_directories(step280_test PRIVATE src)
target_link_libraries(step280_test PRIVATE nlohmann_json::nlohmann_json)

# Step 281: Meta-Programming Annotations
add_executable(step281_test tests/step281_test.cpp)
target_include_directories(step281_test PRIVATE src)
target_link_libraries(step281_test PRIVATE nlohmann_json::nlohmann_json)

# Step 282: Strategy & Policy Annotations
add_executable(step282_test tests/step282_test.cpp)
target_include_directories(step282_test PRIVATE src)
target_link_libraries(step282_test PRIVATE nlohmann_json::nlohmann_json)

# Step 283: Phase 10d Integration Tests
add_executable(step283_test tests/step283_test.cpp)
target_include_directories(step283_test PRIVATE src)
target_link_libraries(step283_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 284: EnvironmentSpec schema & AST node
add_executable(step284_test tests/step284_test.cpp)
target_include_directories(step284_test PRIVATE src)
target_link_libraries(step284_test PRIVATE nlohmann_json::nlohmann_json)

# Step 285: Capability vocabulary & validation
add_executable(step285_test tests/step285_test.cpp)
target_include_directories(step285_test PRIVATE src)
target_link_libraries(step285_test PRIVATE nlohmann_json::nlohmann_json)

# Step 286: Environment-aware pipeline hooks
add_executable(step286_test tests/step286_test.cpp)
target_include_directories(step286_test PRIVATE src)
target_link_libraries(step286_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 287: Environment-aware lowering decisions
add_executable(step287_test tests/step287_test.cpp)
target_include_directories(step287_test PRIVATE src)
target_link_libraries(step287_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Step 288: Host boundary AST nodes
add_executable(step288_test tests/step288_test.cpp)
target_include_directories(step288_test PRIVATE src)
target_link_libraries(step288_test PRIVATE nlohmann_json::nlohmann_json)

# Step 289: Phase 10e integration tests
add_executable(step289_test tests/step289_test.cpp)
target_include_directories(step289_test PRIVATE src)
target_link_libraries(step289_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go
    tree_sitter_org)

# Phase 11a: Semanno Format + Annotation Codegen (Steps 290-296)
foreach(STEP 290 291 292 293 294 295 296)
    add_executable(step${STEP}_test tests/step${STEP}_test.cpp)
    target_include_directories(step${STEP}_test PRIVATE src)
    target_link_libraries(step${STEP}_test PRIVATE
        nlohmann_json::nlohmann_json
        unofficial::tree-sitter::tree-sitter
        tree_sitter_python tree_sitter_cpp tree_sitter_elisp
        tree_sitter_javascript tree_sitter_typescript
        tree_sitter_java tree_sitter_rust tree_sitter_go
        tree_sitter_org)
endforeach()

# Phase 11b: Validation & Conflict Completion (Steps 297-301)
foreach(STEP 297 298 299 300 301)
    add_executable(step${STEP}_test tests/step${STEP}_test.cpp)
    target_include_directories(step${STEP}_test PRIVATE src)
    target_link_libraries(step${STEP}_test PRIVATE
        nlohmann_json::nlohmann_json
        unofficial::tree-sitter::tree-sitter
        tree_sitter_python tree_sitter_cpp tree_sitter_elisp
        tree_sitter_javascript tree_sitter_typescript
        tree_sitter_java tree_sitter_rust tree_sitter_go
        tree_sitter_org)
endforeach()

# Phase 11c: Parser Deepening (Steps 302-308)
add_executable(step302_test tests/step302_test.cpp)
target_include_directories(step302_test PRIVATE src)
target_link_libraries(step302_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step303_test tests/step303_test.cpp)
target_include_directories(step303_test PRIVATE src)
target_link_libraries(step303_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step304_test tests/step304_test.cpp)
target_include_directories(step304_test PRIVATE src)
target_link_libraries(step304_test PRIVATE nlohmann_json::nlohmann_json)

# Step 305: Python + Java Parser Deepening
add_executable(step305_test tests/step305_test.cpp)
target_include_directories(step305_test PRIVATE src)
target_link_libraries(step305_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python
    tree_sitter_java)

# Step 306: TypeScript/JavaScript + Rust Parser Deepening
add_executable(step306_test tests/step306_test.cpp)
target_include_directories(step306_test PRIVATE src)
target_link_libraries(step306_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_javascript
    tree_sitter_typescript
    tree_sitter_rust)

# Step 307: Go + C++ + Elisp Parser Deepening
add_executable(step307_test tests/step307_test.cpp)
target_include_directories(step307_test PRIVATE src)
target_link_libraries(step307_test PRIVATE
    unofficial::tree-sitter::tree-sitter
    tree_sitter_go
    tree_sitter_cpp
    tree_sitter_elisp)

# Step 308: Generator Updates + Phase 11c Integration Tests
add_executable(step308_test tests/step308_test.cpp)
target_include_directories(step308_test PRIVATE src)
target_link_libraries(step308_test PRIVATE nlohmann_json::nlohmann_json)

# Step 309: Kotlin Parser Tests
add_executable(step309_test tests/step309_test.cpp)
target_include_directories(step309_test PRIVATE src)
target_link_libraries(step309_test PRIVATE nlohmann_json::nlohmann_json)

# Step 310: Kotlin Generator Tests
add_executable(step310_test tests/step310_test.cpp)
target_include_directories(step310_test PRIVATE src)
target_link_libraries(step310_test PRIVATE nlohmann_json::nlohmann_json)

# Step 311: C# Parser Tests
add_executable(step311_test tests/step311_test.cpp)
target_include_directories(step311_test PRIVATE src)
target_link_libraries(step311_test PRIVATE nlohmann_json::nlohmann_json)

# Step 312: C# Generator Tests
add_executable(step312_test tests/step312_test.cpp)
target_include_directories(step312_test PRIVATE src)
target_link_libraries(step312_test PRIVATE nlohmann_json::nlohmann_json)

# Step 313: New Languages Integration Tests
add_executable(step313_test tests/step313_test.cpp)
target_include_directories(step313_test PRIVATE src)
target_link_libraries(step313_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 314: Generalized Annotation Inference Engine
add_executable(step314_test tests/step314_test.cpp)
target_include_directories(step314_test PRIVATE src)
target_link_libraries(step314_test PRIVATE nlohmann_json::nlohmann_json)

# Step 315: Routing Annotation Types (Subject 9)
add_executable(step315_test tests/step315_test.cpp)
target_include_directories(step315_test PRIVATE src)
target_link_libraries(step315_test PRIVATE nlohmann_json::nlohmann_json)

# Step 316: Skeleton AST Support
add_executable(step316_test tests/step316_test.cpp)
target_include_directories(step316_test PRIVATE src)
target_link_libraries(step316_test PRIVATE nlohmann_json::nlohmann_json)

# Step 317: Architect Tooling — RPC + MCP
add_executable(step317_test tests/step317_test.cpp)
target_include_directories(step317_test PRIVATE src)
target_link_libraries(step317_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step318_test tests/step318_test.cpp)
target_include_directories(step318_test PRIVATE src)
target_link_libraries(step318_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 320: WorkItem — Core Execution Model
add_executable(step320_test tests/step320_test.cpp)
target_include_directories(step320_test PRIVATE src)
target_link_libraries(step320_test PRIVATE nlohmann_json::nlohmann_json)

# Step 321: TaskQueue — Priority Queue with Dependencies
add_executable(step321_test tests/step321_test.cpp)
target_include_directories(step321_test PRIVATE src)
target_link_libraries(step321_test PRIVATE nlohmann_json::nlohmann_json)

# Step 322: WorkflowState — Project-Level Workflow Tracking
add_executable(step322_test tests/step322_test.cpp)
target_include_directories(step322_test PRIVATE src)
target_link_libraries(step322_test PRIVATE nlohmann_json::nlohmann_json)

# Step 323: Workflow Sidecar Persistence
add_executable(step323_test tests/step323_test.cpp)
target_include_directories(step323_test PRIVATE src)
target_link_libraries(step323_test PRIVATE nlohmann_json::nlohmann_json)

# Step 324: Workflow RPC + MCP Tools
add_executable(step324_test tests/step324_test.cpp)
target_include_directories(step324_test PRIVATE src)
target_link_libraries(step324_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 325: Phase 12a Integration Tests
add_executable(step325_test tests/step325_test.cpp)
target_include_directories(step325_test PRIVATE src)
target_link_libraries(step325_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 326: RoutingEngine — Annotation-to-Dispatch Logic
add_executable(step326_test tests/step326_test.cpp)
target_include_directories(step326_test PRIVATE src)
target_link_libraries(step326_test PRIVATE nlohmann_json::nlohmann_json)

# Step 327: WorkerRegistry — Worker Abstractions
add_executable(step327_test tests/step327_test.cpp)
target_include_directories(step327_test PRIVATE src)
target_link_libraries(step327_test PRIVATE nlohmann_json::nlohmann_json)

# Step 328: Context Assembly + Budget
add_executable(step328_test tests/step328_test.cpp)
target_include_directories(step328_test PRIVATE src)
target_link_libraries(step328_test PRIVATE nlohmann_json::nlohmann_json)

# Step 329: Routing RPC + MCP Tools
add_executable(step329_test tests/step329_test.cpp)
target_include_directories(step329_test PRIVATE src)
target_link_libraries(step329_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 330: Review Gates
add_executable(step330_test tests/step330_test.cpp)
target_include_directories(step330_test PRIVATE src)
target_link_libraries(step330_test PRIVATE nlohmann_json::nlohmann_json)

# Step 331: Phase 12b Integration Tests
add_executable(step331_test tests/step331_test.cpp)
target_include_directories(step331_test PRIVATE src)
target_link_libraries(step331_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

# Step 332: Multiple Inheritance in ClassDeclaration
add_executable(step332_test tests/step332_test.cpp)
target_include_directories(step332_test PRIVATE src)
target_link_libraries(step332_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step333_test tests/step333_test.cpp)
target_include_directories(step333_test PRIVATE src)
target_link_libraries(step333_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step334_test tests/step334_test.cpp)
target_include_directories(step334_test PRIVATE src)
target_link_libraries(step334_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step335_test tests/step335_test.cpp)
target_include_directories(step335_test PRIVATE src)
target_link_libraries(step335_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step336_test tests/step336_test.cpp)
target_include_directories(step336_test PRIVATE src)
target_link_libraries(step336_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step337_test tests/step337_test.cpp)
target_include_directories(step337_test PRIVATE src)
target_link_libraries(step337_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step338_test tests/step338_test.cpp)
target_include_directories(step338_test PRIVATE src)
target_link_libraries(step338_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step339_test tests/step339_test.cpp)
target_include_directories(step339_test PRIVATE src)
target_link_libraries(step339_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step340_test tests/step340_test.cpp)
target_include_directories(step340_test PRIVATE src)
target_link_libraries(step340_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step341_test tests/step341_test.cpp)
target_include_directories(step341_test PRIVATE src)
target_link_libraries(step341_test PRIVATE
    nlohmann_json::nlohmann_json
    unofficial::tree-sitter::tree-sitter
    tree_sitter_python tree_sitter_cpp tree_sitter_elisp
    tree_sitter_javascript tree_sitter_typescript
    tree_sitter_java tree_sitter_rust tree_sitter_go)

add_executable(step342_test tests/step342_test.cpp)
target_include_directories(step342_test PRIVATE src)
target_link_libraries(step342_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step343_test tests/step343_test.cpp)
target_include_directories(step343_test PRIVATE src)
target_link_libraries(step343_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step344_test tests/step344_test.cpp)
target_include_directories(step344_test PRIVATE src)
target_link_libraries(step344_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step345_test tests/step345_test.cpp)
target_include_directories(step345_test PRIVATE src)
target_link_libraries(step345_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step346_test tests/step346_test.cpp)
target_include_directories(step346_test PRIVATE src)
target_link_libraries(step346_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step347_test tests/step347_test.cpp)
target_include_directories(step347_test PRIVATE src)
target_link_libraries(step347_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step348_test tests/step348_test.cpp)
target_include_directories(step348_test PRIVATE src)
target_link_libraries(step348_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step349_test tests/step349_test.cpp)
target_include_directories(step349_test PRIVATE src)
target_link_libraries(step349_test PRIVATE nlohmann_json::nlohmann_json)

add_executable(step350_test tests/step350_test.cpp)
target_include_directories(step350_test PRIVATE src)
target_link_libraries(step350_test PRIVATE nlohmann_json::nlohmann_json)

# Step 12: Dear ImGui shell scaffolding created (main.cpp exists but not built due to dependencies)
