First pass windows build
This commit is contained in:
+12
-4
@@ -8,16 +8,24 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||||||
find_package(CURL REQUIRED)
|
find_package(CURL REQUIRED)
|
||||||
find_package(nlohmann_json REQUIRED)
|
find_package(nlohmann_json REQUIRED)
|
||||||
|
|
||||||
add_library(drharness_lib
|
set(TOOL_SOURCES
|
||||||
src/tool_registry.cpp
|
|
||||||
src/ollama_client.cpp
|
|
||||||
src/harness.cpp
|
|
||||||
tools/shell_tool.cpp
|
tools/shell_tool.cpp
|
||||||
tools/agent_tool.cpp
|
tools/agent_tool.cpp
|
||||||
tools/edit_tool.cpp
|
tools/edit_tool.cpp
|
||||||
tools/file_list_tool.cpp
|
tools/file_list_tool.cpp
|
||||||
tools/file_read_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_include_directories(drharness_lib PUBLIC include tools)
|
||||||
target_link_libraries(drharness_lib
|
target_link_libraries(drharness_lib
|
||||||
PUBLIC nlohmann_json::nlohmann_json
|
PUBLIC nlohmann_json::nlohmann_json
|
||||||
|
|||||||
@@ -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
@@ -2,7 +2,9 @@
|
|||||||
#include "ollama_client.hpp"
|
#include "ollama_client.hpp"
|
||||||
#include "tool_registry.hpp"
|
#include "tool_registry.hpp"
|
||||||
#include "agent_profile.hpp"
|
#include "agent_profile.hpp"
|
||||||
|
#if !defined(_WIN32)
|
||||||
#include "shell_tool.hpp"
|
#include "shell_tool.hpp"
|
||||||
|
#endif
|
||||||
#include "agent_tool.hpp"
|
#include "agent_tool.hpp"
|
||||||
#include "edit_tool.hpp"
|
#include "edit_tool.hpp"
|
||||||
#include "file_list_tool.hpp"
|
#include "file_list_tool.hpp"
|
||||||
@@ -14,6 +16,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
static const std::vector<AgentProfile> profiles = {
|
static const std::vector<AgentProfile> profiles = {
|
||||||
|
#if !defined(_WIN32)
|
||||||
{
|
{
|
||||||
.name = "shell_expert",
|
.name = "shell_expert",
|
||||||
.description = "An agent that can run shell commands to inspect the system, "
|
.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",
|
.model = "gemma4:26b",
|
||||||
.tool_names = {"run_shell"}
|
.tool_names = {"run_shell"}
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
// Add more agent profiles here
|
// Add more agent profiles here
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,10 +41,12 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
ToolRegistry master_registery;
|
ToolRegistry master_registery;
|
||||||
ToolRegistry agent_tools;
|
ToolRegistry agent_tools;
|
||||||
master_registery.register_tool(make_shell_tool());
|
|
||||||
master_registery.register_tool(make_edit_tool());
|
master_registery.register_tool(make_edit_tool());
|
||||||
master_registery.register_tool(make_file_list_tool());
|
master_registery.register_tool(make_file_list_tool());
|
||||||
master_registery.register_tool(make_file_read_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:
|
// Add more base tools here:
|
||||||
|
|
||||||
for (const auto& profile : profiles)
|
for (const auto& profile : profiles)
|
||||||
|
|||||||
Reference in New Issue
Block a user