Add boost::random_device to pcg
This commit is contained in:
parent
342519003c
commit
06916083bb
3 changed files with 20 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
15
libs/pcg/include/psemek/pcg/random/device.hpp
Normal file
15
libs/pcg/include/psemek/pcg/random/device.hpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <boost/nondet_random.hpp>
|
||||
|
||||
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<random_device::result_type>);
|
||||
static_assert(std::is_unsigned_v<random_device::result_type>);
|
||||
static_assert(sizeof(random_device::result_type) == 4);
|
||||
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue