diff --git a/.appveyor.yml b/.appveyor.yml index e510f06b..bd1ad519 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,33 +11,67 @@ environment: matrix: fast_finish: true cache: - - c:\projects\glbinding - - c:\projects\build-glbinding -> appveyor.yml - - c:\tools\vcpkg\installed\ + - C:\projects\glfw + - C:\projects\glbinding + - C:\projects\glm + - C:\projects\sioclient + - C:\projects\build-glfw -> appveyor.yml + - C:\projects\build-glbinding -> appveyor.yml + - C:\projects\build-glm -> appveyor.yml + - C:\projects\build-sioclient -> appveyor.yml install: - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - - vcpkg --triplet x64-windows install glm glfw3 sfml boost-system boost-exception boost-date-time boost-random boost-asio - - - cd c:\tools\vcpkg - - vcpkg integrate install - - cd C:\projects + - if not exist build-glfw mkdir build-glfw + - if not exist build-glm mkdir build-glm - if not exist build-glbinding mkdir build-glbinding + - if not exist build-sioclient mkdir build-sioclient + + - if not exist "C:\projects\glfw" git clone --depth 1 --no-checkout https://github.com/glfw/glfw.git C:\projects\glfw + - cd C:\projects\glfw + - git fetch --depth 1 --tags + - git checkout %GLFW_VER% + - cd ../build-glfw + - cmake -DCMAKE_INSTALL_PREFIX=C:\deps\glfw -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -G "Visual Studio 15 2017 Win64" ../glfw + - cmake --build . --config %CONFIGURATION% + - cmake --build . --config %CONFIGURATION% --target install + + - if not exist "C:\projects\glm" git clone --depth 1 --no-checkout https://github.com/g-truc/glm.git C:\projects\glm + - cd C:\projects\glm + - git fetch --depth 1 --tags + - git checkout %GLM_VER% + - cd ../build-glm + - cmake -DCMAKE_INSTALL_PREFIX=C:\deps\glm -DGLM_INSTALL_ENABLE=true -G "Visual Studio 15 2017 Win64" ../glm + - cmake --build . --config %CONFIGURATION% + - cmake --build . --config %CONFIGURATION% --target install - if not exist "C:\projects\glbinding" git clone --depth 1 --no-checkout https://github.com/cginternals/glbinding C:\projects\glbinding - cd C:\projects\glbinding - git fetch --depth 1 --tags - git checkout v%GLBINDING_VER% - cd ../build-glbinding - - cmake -DCMAKE_INSTALL_PREFIX=C:\deps\glbinding -DCMAKE_CXX_FLAGS="/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /EHsc" -DBUILD_SHARED_LIBS=OFF -DOPTION_BUILD_TESTS=OFF -DOPTION_BUILD_GPU_TESTS=OFF -DOPTION_BUILD_TOOLS=OFF -G "Visual Studio 15 2017 Win64" ../glbinding + - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=C:\deps\glbinding -DCMAKE_CXX_FLAGS="/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /EHsc" -DCMAKE_PREFIX_PATH=C:\deps\glfw -DBUILD_SHARED_LIBS=OFF -DOPTION_BUILD_TESTS=OFF -DOPTION_BUILD_GPU_TESTS=OFF -DOPTION_BUILD_TOOLS=OFF -G "Visual Studio 15 2017 Win64" ../glbinding - cmake --build . --config %CONFIGURATION% - cmake --build . --config %CONFIGURATION% --target install + - if not exist "C:\projects\sioclient" git clone --depth 1 --branch fixes https://github.com/SwarmMind/socket.io-client-cpp.git C:\projects\sioclient + - cd C:\projects\sioclient + - git fetch --depth 1 --tags + - cd ../build-sioclient + - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=C:\deps\sioclient -DCMAKE_CXX_FLAGS="/D_SCL_SECURE_NO_WARNINGS /EHsc" -DBOOST_ROOT=C:\Libraries\boost_1_67_0 -DBOOST_VER=1.67.0 -G "Visual Studio 15 2017 Win64" ../sioclient + - cmake --build . --config %CONFIGURATION% + - cmake --build . --config %CONFIGURATION% --target install + + - if not exist "C:\deps\sfml" mkdir "C:\deps\sfml" + - ps: appveyor DownloadFile "https://www.sfml-dev.org/files/SFML-$env:SFML_VER-windows-vc15-64-bit.zip" -FileName "C:\deps\sfml\sfml.zip" + - cd "C:\deps\sfml" + - 7z x sfml.zip + before_build: - cd C:\projects\swarmmind-client - mkdir build && cd build - - cmake -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=C:\deps\glbinding -DBOOST_ROOT=C:\Libraries\boost_1_67_0 -G "Visual Studio 15 2017 Win64" .. + - cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_PREFIX_PATH=C:\deps\glfw;C:\deps\glbinding;C:\deps\sioclient;C:\deps\sfml\SFML-%SFML_VER% -G "Visual Studio 15 2017 Win64" .. build: project: build\SwarmMind-Client.sln verbosity: minimal @@ -51,7 +85,7 @@ after_build: - ps: cp -r -v shaders package - ps: cp -r -v sound package - ps: cp -r -v res package - - ps: cp -r -v build\src\$env:CONFIGURATION\*.dll package + - ps: cp C:\deps\sfml\SFML-$env:SFML_VER\bin\openal32.dll package artifacts: - path: package diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ce2f73c..169ec7e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,9 @@ find_package(glfw3 REQUIRED) find_package(glbinding REQUIRED) find_package(glm REQUIRED) +set(SFML_STATIC_LIBRARIES TRUE) find_package(SFML COMPONENTS audio REQUIRED) +find_package(sioclient 1.6.0 REQUIRED) set(sources "main.cpp") @@ -16,8 +18,6 @@ add_subdirectory(menu) add_subdirectory(events) add_subdirectory(sound) -add_subdirectory(sioclient) - #Replicate the directory structure in Visual Studio filters source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${sources}) diff --git a/src/nlohmann/json.hpp b/src/nlohmann/json.hpp index c40620ad..ad3d6690 100644 --- a/src/nlohmann/json.hpp +++ b/src/nlohmann/json.hpp @@ -1,11 +1,10 @@ /* __ _____ _____ _____ __| | __| | | | JSON for Modern C++ -| | |__ | | | | | | version 3.3.0 +| | |__ | | | | | | version 3.1.2 |_____|_____|_____|_|___| https://github.com/nlohmann/json Licensed under the MIT License . -SPDX-License-Identifier: MIT Copyright (c) 2013-2018 Niels Lohmann . Permission is hereby granted, free of charge, to any person obtaining a copy @@ -31,8 +30,8 @@ SOFTWARE. #define NLOHMANN_JSON_HPP #define NLOHMANN_JSON_VERSION_MAJOR 3 -#define NLOHMANN_JSON_VERSION_MINOR 3 -#define NLOHMANN_JSON_VERSION_PATCH 0 +#define NLOHMANN_JSON_VERSION_MINOR 1 +#define NLOHMANN_JSON_VERSION_PATCH 2 #include // all_of, find, for_each #include // assert @@ -67,10 +66,10 @@ namespace nlohmann @brief default JSONSerializer template argument This serializer ignores the template arguments and uses ADL -([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) +([argument-dependent lookup](http://en.cppreference.com/w/cpp/language/adl)) for serialization. */ -template +template struct adl_serializer; template class ObjectType = @@ -119,15 +118,13 @@ using json = basic_json<>; // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them // exclude unsupported compilers -#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) - #if defined(__clang__) - #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 - #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) - #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 - #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" - #endif +#if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif +#elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" #endif #endif @@ -157,12 +154,10 @@ using json = basic_json<>; #define JSON_THROW(exception) throw exception #define JSON_TRY try #define JSON_CATCH(exception) catch(exception) - #define JSON_INTERNAL_CATCH(exception) catch(exception) #else #define JSON_THROW(exception) std::abort() #define JSON_TRY if(true) #define JSON_CATCH(exception) if(false) - #define JSON_INTERNAL_CATCH(exception) if(false) #endif // override exception macros @@ -177,12 +172,6 @@ using json = basic_json<>; #if defined(JSON_CATCH_USER) #undef JSON_CATCH #define JSON_CATCH JSON_CATCH_USER - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_CATCH_USER -#endif -#if defined(JSON_INTERNAL_CATCH_USER) - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER #endif // manual branch prediction @@ -218,17 +207,62 @@ using json = basic_json<>; NumberIntegerType, NumberUnsignedType, NumberFloatType, \ AllocatorType, JSONSerializer> -// #include +/*! +@brief Helper to determine whether there's a key_type for T. + +This helper is used to tell associative containers apart from other containers +such as sequence containers. For instance, `std::map` passes the test as it +contains a `mapped_type`, whereas `std::vector` fails the test. + +@sa http://stackoverflow.com/a/7728728/266378 +@since version 1.0.0, overworked in version 2.0.6 +*/ +#define NLOHMANN_JSON_HAS_HELPER(type) \ + template struct has_##type { \ + private: \ + template \ + static int detect(U &&); \ + static void detect(...); \ + public: \ + static constexpr bool value = \ + std::is_integral()))>::value; \ + } + +// #include #include // not #include // size_t +#include // numeric_limits #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // declval + +// #include + +// #include + namespace nlohmann { +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ namespace detail { +///////////// +// helpers // +///////////// + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + // alias templates to reduce boilerplate template using enable_if_t = typename std::enable_if::type; @@ -267,188 +301,33 @@ template<> struct make_index_sequence<1> : index_sequence<0> {}; template using index_sequence_for = make_index_sequence; -// dispatch utility (taken from ranges-v3) -template struct priority_tag : priority_tag < N - 1 > {}; -template<> struct priority_tag<0> {}; - -// taken from ranges-v3 -template -struct static_const -{ - static constexpr T value{}; -}; - -template -constexpr T static_const::value; -} -} - -// #include - - -#include // not -#include // numeric_limits -#include // false_type, is_constructible, is_integral, is_same, true_type -#include // declval - -// #include - -// #include - -// #include - - -#include - -// #include - - -namespace nlohmann -{ -namespace detail -{ -template struct make_void -{ - using type = void; -}; -template using void_t = typename make_void::type; -} -} - - -// http://en.cppreference.com/w/cpp/experimental/is_detected -namespace nlohmann -{ -namespace detail -{ -struct nonesuch -{ - nonesuch() = delete; - ~nonesuch() = delete; - nonesuch(nonesuch const&) = delete; - void operator=(nonesuch const&) = delete; -}; - -template class Op, - class... Args> -struct detector -{ - using value_t = std::false_type; - using type = Default; -}; - -template class Op, class... Args> -struct detector>, Op, Args...> -{ - using value_t = std::true_type; - using type = Op; -}; - -template