diff --git a/CMakeLists.txt b/CMakeLists.txt index b41c5a97..3f1be0ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Cl list(APPEND PSEMEK_CXX_FLAGS -Wall -Werror -Wextra -pedantic -Wno-narrowing -Wno-sign-compare) endif() +set(Boost_USE_STATIC_LIBS ON) + add_subdirectory(package) add_subdirectory(tools) add_subdirectory(libs) diff --git a/libs/pcg/CMakeLists.txt b/libs/pcg/CMakeLists.txt index b7f9d64e..0f1a18b9 100644 --- a/libs/pcg/CMakeLists.txt +++ b/libs/pcg/CMakeLists.txt @@ -1,6 +1,8 @@ +find_package(Boost COMPONENTS random REQUIRED) + file(GLOB_RECURSE PSEMEK_PCG_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "include/*.hpp") file(GLOB_RECURSE PSEMEK_PCG_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "source/*.cpp") add_library(psemek-pcg ${PSEMEK_PCG_HEADERS} ${PSEMEK_PCG_SOURCES}) target_include_directories(psemek-pcg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(psemek-pcg PUBLIC psemek-util psemek-geom psemek-gfx) +target_link_libraries(psemek-pcg PUBLIC psemek-util psemek-geom psemek-gfx Boost::random) diff --git a/libs/pcg/include/psemek/pcg/random/device.hpp b/libs/pcg/include/psemek/pcg/random/device.hpp new file mode 100644 index 00000000..1275ab9d --- /dev/null +++ b/libs/pcg/include/psemek/pcg/random/device.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace psemek::pcg +{ + + using random_device = boost::random_device; + + // check that random_device::result_type is basically std::uint32_t + static_assert(std::is_integral_v); + static_assert(std::is_unsigned_v); + static_assert(sizeof(random_device::result_type) == 4); + +}