Move the solver code to its own library

This commit is contained in:
Drew Galbraith 2023-05-04 00:01:51 -07:00
parent dd89c1fd6c
commit dc3f23d111
6 changed files with 11 additions and 8 deletions

View File

@ -5,11 +5,14 @@ project(Sudoku)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(SOURCE_FILES
set(LIB_SOURCE_FILES
solver/cell.cpp
solver/puzzle.cpp
solver/solver.cpp
solver.cpp
)
add_executable(solver ${SOURCE_FILES})
add_library(solver ${LIB_SOURCE_FILES})
target_include_directories(solver PUBLIC "${PROJECT_SOURCE_DIR}")
add_executable(test_solver solver.cpp)
target_link_libraries(test_solver PUBLIC solver)

View File

@ -1,4 +1,4 @@
#include "cell.h"
#include "solver/cell.h"
#include <algorithm>
#include <cassert>

View File

@ -1,4 +1,4 @@
#include "puzzle.h"
#include "solver/puzzle.h"
#include <algorithm>
#include <cassert>

View File

@ -3,7 +3,7 @@
#include <optional>
#include <string>
#include "cell.h"
#include "solver/cell.h"
class Puzzle {
public:

View File

@ -1,4 +1,4 @@
#include "solver.h"
#include "solver/solver.h"
#include <sstream>

View File

@ -1,6 +1,6 @@
#pragma once
#include "puzzle.h"
#include "solver/puzzle.h"
class Solver {
public: