From 5a95eb1282e30bd803d7e0b352a8443795842e42 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 2 Nov 2022 19:03:32 +0100 Subject: fix build with Linux and/or GCC --- src/CMakeLists.txt | 9 +++++++-- src/random.cpp | 2 +- src/tile-atlas.hpp | 2 -- src/tile.hpp | 2 +- src/world.hpp | 2 -- 5 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9c4ac952..85e6bf5b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,10 +6,15 @@ target_link_libraries( Magnum::GL Magnum::Magnum Magnum::Shaders - Magnum::AnyImageImporter - Magnum::TgaImporter nlohmann_json::nlohmann_json ) if(FLOORMAT_PRECOMPILED-HEADERS) target_precompile_headers(${self} PRIVATE precomp.hpp) endif() + +if(WIN32 OR MAGNUM_BUILD_STATIC) + target_link_libraries(${self} PUBLIC + Magnum::AnyImageImporter + Magnum::TgaImporter + ) +endif() diff --git a/src/random.cpp b/src/random.cpp index 4da534a3..d3e45292 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -18,7 +18,7 @@ std::size_t random_engine_impl::operator()() if constexpr(sizeof(std::size_t) > sizeof(std::uint32_t)) { constexpr std::size_t N = (sizeof(std::size_t) + sizeof(std::uint32_t)-1) / sizeof(std::uint32_t); - static_assert(N >= 2); + static_assert(N >= 1); union { std::size_t x; std::uint32_t a[N]; diff --git a/src/tile-atlas.hpp b/src/tile-atlas.hpp index b46cf686..026d2073 100644 --- a/src/tile-atlas.hpp +++ b/src/tile-atlas.hpp @@ -5,8 +5,6 @@ #include #include -namespace std::filesystem { class path; } - namespace floormat { struct tile_atlas final diff --git a/src/tile.hpp b/src/tile.hpp index ab55ca11..b7bacc8d 100644 --- a/src/tile.hpp +++ b/src/tile.hpp @@ -25,7 +25,7 @@ struct tile_proto final { std::shared_ptr ground_atlas, wall_north_atlas, wall_west_atlas; variant_t ground_variant = 0, wall_north_variant = 0, wall_west_variant = 0; - pass_mode pass_mode = pass_mode::pass_shoot_through; + enum pass_mode pass_mode = pass_mode::pass_shoot_through; tile_image_proto ground_image() const noexcept; tile_image_proto wall_north_image() const noexcept; diff --git a/src/world.hpp b/src/world.hpp index 9b58ff3d..195d4903 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -6,8 +6,6 @@ #include #include -namespace std::filesystem { class path; } - namespace floormat { struct world final -- cgit v1.2.3