diff --git a/README.md b/README.md index adb5ae9ce..77f07cf1a 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ git submodule update --init --recursive * All the other dependencies (Boost, SDL2) need to be supplied separately. Install [Vcpkg](https://github.com/Microsoft/vcpkg) and run the following command: ```cmd -vcpkg install sdl2 boost-locale boost-system boost-program-options boost-filesystem boost-uuid boost-crc +vcpkg install sdl2 boost-locale boost-program-options boost-uuid boost-crc ``` * Copy the original XCom:Apocalypse .iso file into the "data/" directory. This could also be a directory containing all the extracted files from the CD, and it should be named the same (IE the directory should be data/cd.iso/). This is used during the build to extract some data tables. @@ -161,7 +161,7 @@ vcpkg install sdl2 boost-locale boost-system boost-program-options boost-filesys * On Ubuntu, install the following packages: ```sh -sudo apt-get install libsdl2-dev cmake build-essential git libunwind8-dev libboost-locale-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev +sudo apt-get install libsdl2-dev cmake build-essential git libunwind8-dev libboost-locale-dev libboost-filesystem-dev libboost-program-options-dev ``` * On Mageia, install the following packages as root: diff --git a/appveyor-dev.yml b/appveyor-dev.yml index 6beda3ce7..03cb4ae2c 100644 --- a/appveyor-dev.yml +++ b/appveyor-dev.yml @@ -21,7 +21,7 @@ init: #clone_depth: 10 cache: c:\tools\vcpkg\installed before_build: - - vcpkg install sdl2 boost-locale boost-system boost-program-options boost-filesystem boost-uuid boost-crc + - vcpkg install sdl2 boost-locale boost-program-options boost-uuid boost-crc - vcpkg upgrade --no-dry-run - git submodule update --init --recursive - curl http://s2.jonnyh.net/pub/cd_minimal.iso.xz -o temp\cd.iso.xz diff --git a/appveyor.yml b/appveyor.yml index 45bff0100..4437df848 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ init: #clone_depth: 10 cache: c:\tools\vcpkg\installed before_build: - - vcpkg install sdl2 boost-locale boost-system boost-program-options boost-filesystem boost-uuid boost-crc + - vcpkg install sdl2 boost-locale boost-program-options boost-uuid boost-crc - vcpkg upgrade --no-dry-run - git submodule update --init --recursive - curl http://s2.jonnyh.net/pub/cd_minimal.iso.xz -o temp\cd.iso.xz diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index e6da5cce6..b479e0fe6 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -214,16 +214,21 @@ set(BOOST_PACKAGES locale system program_options) set(USE_EXPERIMENTAL_FILESYSTEM FALSE) if(CMAKE_COMPILER_IS_GNUCC) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.3 OR - CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.3) - set(USE_EXPERIMENTAL_FILESYSTEM TRUE) - endif() + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.3 OR + CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.3) + set(USE_EXPERIMENTAL_FILESYSTEM TRUE) + target_link_libraries(OpenApoc_Framework PUBLIC stdc++fs) + endif() +endif() +if(MSVC) + if (MSVC_VERSION GREATER_EQUAL 1900) + set(USE_EXPERIMENTAL_FILESYSTEM TRUE) + endif() endif() if (USE_EXPERIMENTAL_FILESYSTEM) message(STATUS "Using ") target_compile_definitions(OpenApoc_Framework PUBLIC "-DUSE_EXPERIMENTAL_FILESYSTEM") - target_link_libraries(OpenApoc_Framework PUBLIC stdc++fs) else() message(STATUS "Using ") set(BOOST_PACKAGES ${BOOST_PACKAGES} filesystem) diff --git a/framework/filesystem.h b/framework/filesystem.h index d0c9efe1a..f7a435398 100644 --- a/framework/filesystem.h +++ b/framework/filesystem.h @@ -1,13 +1,7 @@ #pragma once -// Enable by default on MSVC, as we only support 2015+ anyway -#if !defined(USE_BOOST_FILESYSTEM) && !defined(USE_EXPERIMENTAL_FILESYSTEM) && defined(_MSC_VER) -#define USE_EXPERIMENTAL_FILESYSTEM -#endif - #if defined(USE_BOOST_FILESYSTEM) -#define BOOST_ALL_NO_LIB #include namespace fs = boost::filesystem;