diff --git a/libgm/CMakeLists.txt b/libgm/CMakeLists.txt index 67c7f92..06a02a6 100644 --- a/libgm/CMakeLists.txt +++ b/libgm/CMakeLists.txt @@ -8,7 +8,8 @@ option(STATIC_BUILD "Create static build of GateMate tools" ON) set(PROGRAM_PREFIX "" CACHE STRING "Name prefix for executables") -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -bigobj -EHsc") else() @@ -31,7 +32,6 @@ else() endif() endif() if (WASI) - set(USE_THREADS OFF) add_definitions( -DBOOST_EXCEPTION_DISABLE -DBOOST_NO_EXCEPTIONS @@ -40,15 +40,8 @@ if (WASI) -DBOOST_NO_CXX11_HDR_MUTEX -DBOOST_NO_CXX11_HDR_ATOMIC ) -else() - set(USE_THREADS ON) -endif() -set(boost_libs filesystem program_options system) -if (USE_THREADS) - list(APPEND boost_libs thread) -else() - add_definitions(-DNO_THREADS) endif() +set(boost_libs program_options) find_package(Boost REQUIRED COMPONENTS ${boost_libs}) diff --git a/libgm/include/Bitstream.hpp b/libgm/include/Bitstream.hpp index dd8fa3a..552a674 100644 --- a/libgm/include/Bitstream.hpp +++ b/libgm/include/Bitstream.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/libgm/include/Util.hpp b/libgm/include/Util.hpp index 347f22f..398a930 100644 --- a/libgm/include/Util.hpp +++ b/libgm/include/Util.hpp @@ -20,7 +20,8 @@ #ifndef LIBGATEMATE_UTIL_HPP #define LIBGATEMATE_UTIL_HPP -#include +#include +#include #include #include #include @@ -50,8 +51,8 @@ inline uint32_t parse_uint32(std::string str) { return uint32_t(strtoul(str.c_st inline std::string to_string(const std::vector &bv) { std::ostringstream os; - for (auto bit : boost::adaptors::reverse(bv)) - os << (bit ? '1' : '0'); + for (auto it = bv.rbegin(); it != bv.rend(); ++it) + os << (*it ? '1' : '0'); return os.str(); } @@ -60,7 +61,8 @@ inline std::istream &operator>>(std::istream &in, std::vector &bv) bv.clear(); std::string s; in >> s; - for (auto c : boost::adaptors::reverse(s)) { + for (auto it = s.rbegin(); it != s.rend(); ++it) { + char c = *it; assert((c == '0') || (c == '1')); bv.push_back((c == '1')); } diff --git a/libgm/src/Bitstream.cpp b/libgm/src/Bitstream.cpp index 6b1d7b6..fc55996 100644 --- a/libgm/src/Bitstream.cpp +++ b/libgm/src/Bitstream.cpp @@ -19,8 +19,6 @@ #include "Bitstream.hpp" #include -#include -#include #include #include #include "Chip.hpp" diff --git a/libgm/tools/gmpack.cpp b/libgm/tools/gmpack.cpp index 4a615d6..8ef9222 100644 --- a/libgm/tools/gmpack.cpp +++ b/libgm/tools/gmpack.cpp @@ -17,8 +17,8 @@ * */ -#include #include +#include #include #include #include @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) if (vm.count("help")) { help: - boost::filesystem::path path(argv[0]); + std::filesystem::path path(argv[0]); std::cerr << "Open Source Tools for GateMate FPGAs Version " << git_describe_str << std::endl; std::cerr << "Copyright (C) 2024 The Project Peppercorn Authors" << std::endl; std::cerr << std::endl; diff --git a/libgm/tools/gmunpack.cpp b/libgm/tools/gmunpack.cpp index bb5e664..d5549d6 100644 --- a/libgm/tools/gmunpack.cpp +++ b/libgm/tools/gmunpack.cpp @@ -17,9 +17,8 @@ * */ -#include -#include #include +#include #include #include #include @@ -58,7 +57,7 @@ int main(int argc, char *argv[]) if (vm.count("help")) { help: - boost::filesystem::path path(argv[0]); + std::filesystem::path path(argv[0]); std::cerr << "Open Source Tools for GateMate FPGAs Version " << git_describe_str << std::endl; std::cerr << "Copyright (C) 2024 The Project Peppercorn Authors" << std::endl; std::cerr << std::endl;