mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
Add sqlite load into Database.Seed
This commit is contained in:
@@ -111,8 +111,9 @@ if(NOT BIERGARTEN_MOCK_ONLY)
|
||||
)
|
||||
FetchContent_MakeAvailable(llama-cpp)
|
||||
endif()
|
||||
|
||||
if (NOT APPLE)
|
||||
find_package(OpenMP REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# spdlog
|
||||
@@ -249,9 +250,10 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
includes
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
$<$<NOT:$<BOOL:${BIERGARTEN_MOCK_ONLY}>>:llama>
|
||||
$<$<NOT:$<BOOL:${BIERGARTEN_MOCK_ONLY}>>:OpenMP::OpenMP_CXX>
|
||||
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
|
||||
boost::di
|
||||
Boost::json
|
||||
Boost::program_options
|
||||
|
||||
@@ -54,11 +54,11 @@ void XegerGenerator::Visit(const Alternation& node) {
|
||||
}
|
||||
|
||||
void XegerGenerator::Visit(const Repeat& node) {
|
||||
const int lo = node.min;
|
||||
const int hi = (node.max < 0) ? node.min + unbounded_cap_ : node.max;
|
||||
std::uniform_int_distribution<int> dist(lo, hi);
|
||||
const int count = dist(rng_);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const unsigned int low = node.min;
|
||||
const unsigned int high = node.max.value_or(node.min + unbounded_cap_);
|
||||
std::uniform_int_distribution<unsigned int> dist(low, high);
|
||||
const unsigned int count = dist(rng_);
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
node.child->Accept(*this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user