diff --git a/.gitignore b/.gitignore index 32ce0889..2b77ef12 100644 --- a/.gitignore +++ b/.gitignore @@ -86,4 +86,5 @@ code/ !/assets/**/*custom*/**/*.bin # Torch hash torch.hash.yml -merge/ \ No newline at end of file +merge/ +.vs/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index b2e72ca4..21cb9dd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ if(NOT CMAKE_BUILD_TYPE ) endif() vcpkg_bootstrap() -vcpkg_install_packages(fontconfig sdl2 zlib bzip2 libzip libpng getopt dirent libusb pthread glew glfw3) +vcpkg_install_packages(fontconfig sdl2 zlib bzip2 libzip libpng getopt dirent libusb pthread glew glfw3 nlohmann-json tinyxml2 spdlog) endif() if (MSVC) @@ -47,6 +47,21 @@ else() set(CPP "${CMAKE_C_COMPILER}" "-E" "-P" "-Wno-trigraphs" "-x" "c") endif() +################################################################################ +# Set target arch type if empty. Visual studio solution generator provides it. +################################################################################ +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(NOT CMAKE_VS_PLATFORM_NAME) + set(CMAKE_VS_PLATFORM_NAME "x64") + endif() + message("${CMAKE_VS_PLATFORM_NAME} architecture in use") + + if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64" + OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")) + message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!") + endif() +endif() + # Set game compilation version set(VERSION us) set(USE_NETWORKING OFF) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 7b96a425..88ef9fbe 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -13,7 +13,10 @@ #include "port/Enhancements/mods.h" #include #include + +#ifdef USE_NETWORKING #include +#endif #include