First pass windows build

This commit is contained in:
2026-05-05 09:22:41 -05:00
parent 1679818167
commit 7a368fa86b
3 changed files with 38 additions and 5 deletions
+12 -4
View File
@@ -8,16 +8,24 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(CURL REQUIRED)
find_package(nlohmann_json REQUIRED)
add_library(drharness_lib
src/tool_registry.cpp
src/ollama_client.cpp
src/harness.cpp
set(TOOL_SOURCES
tools/shell_tool.cpp
tools/agent_tool.cpp
tools/edit_tool.cpp
tools/file_list_tool.cpp
tools/file_read_tool.cpp
)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(REMOVE_ITEM TOOL_SOURCES tools/shell_tool.cpp)
endif()
add_library(drharness_lib
src/tool_registry.cpp
src/ollama_client.cpp
src/harness.cpp
${TOOL_SOURCES}
)
target_include_directories(drharness_lib PUBLIC include tools)
target_link_libraries(drharness_lib
PUBLIC nlohmann_json::nlohmann_json
+19
View File
@@ -0,0 +1,19 @@
# cmake/toolchains/x86_64-w64-mingw32.cmake
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
# Use the mingw compilers directly
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
# Gentoo's mingw-w64 sysroot
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32/)
# Configuration for pkg-config (helps find library libs)
set(PKG_CONFIG_EXECUTABLE x86_64-w64-mingw32-pkg-config)
set(PKG_CONFIG_LIBDIR /usr/x86_64-w64-mingw32/x86_64-w64-mingw32/lib/pkgconfig)
# Strict system path lookup for cross-compiling
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+7 -1
View File
@@ -2,7 +2,9 @@
#include "ollama_client.hpp"
#include "tool_registry.hpp"
#include "agent_profile.hpp"
#if !defined(_WIN32)
#include "shell_tool.hpp"
#endif
#include "agent_tool.hpp"
#include "edit_tool.hpp"
#include "file_list_tool.hpp"
@@ -14,6 +16,7 @@
#include <vector>
static const std::vector<AgentProfile> profiles = {
#if !defined(_WIN32)
{
.name = "shell_expert",
.description = "An agent that can run shell commands to inspect the system, "
@@ -21,6 +24,7 @@ static const std::vector<AgentProfile> profiles = {
.model = "gemma4:26b",
.tool_names = {"run_shell"}
},
#endif
// Add more agent profiles here
};
@@ -37,10 +41,12 @@ int main(int argc, char** argv) {
ToolRegistry master_registery;
ToolRegistry agent_tools;
master_registery.register_tool(make_shell_tool());
master_registery.register_tool(make_edit_tool());
master_registery.register_tool(make_file_list_tool());
master_registery.register_tool(make_file_read_tool());
#if !defined(_WIN32)
master_registery.register_tool(make_shell_tool());
#endif
// Add more base tools here:
for (const auto& profile : profiles)