From 9586474fa825eb2182e559f774278dc2d95236ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Tue, 15 Aug 2023 12:47:27 +0200 Subject: [PATCH] Removed remaining dependency on boost --- .github/workflows/build.yml | 6 +++--- CMakeLists.txt | 13 ------------- CMakePresets.json | 1 - INSTALL-MSYS2.md | 2 +- INSTALL-MacOSX.md | 2 +- INSTALL.md | 3 +-- docs/using_vscode_to_compile_and_install.md | 1 - src/CMakeLists.txt | 2 -- src/tools/CMakeLists.txt | 1 - vcpkg.json | 9 --------- 10 files changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3f74474..5e6bd383 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: run: sudo apt install gcc-9 g++-9 && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 && sudo update-alternatives --set gcc /usr/bin/gcc-9 if: matrix.host_os == 'ubuntu-18.04' - name: Install Colobot dependencies - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libphysfs-dev gettext git po4a vorbis-tools librsvg2-bin xmlstarlet libglm-dev libmpg123-dev + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libphysfs-dev gettext git po4a vorbis-tools librsvg2-bin xmlstarlet libglm-dev libmpg123-dev if: matrix.container == '' - uses: actions/checkout@v2 - name: Checkout the Google Test submodule @@ -88,7 +88,7 @@ jobs: fail-fast: false steps: - name: Install Colobot dependencies - run: brew install cmake sdl2 sdl2_image sdl2_ttf boost glew physfs flac libsndfile libvorbis vorbis-tools gettext libicns librsvg wget xmlstarlet glm + run: brew install cmake sdl2 sdl2_image sdl2_ttf glew physfs flac libsndfile libvorbis vorbis-tools gettext libicns librsvg wget xmlstarlet glm if: matrix.container == '' - uses: actions/checkout@v2 - name: Checkout the Google Test submodule @@ -195,7 +195,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Colobot dependencies - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libphysfs-dev gettext git po4a vorbis-tools librsvg2-bin xmlstarlet doxygen graphviz libglm-dev libmpg123-dev + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libphysfs-dev gettext git po4a vorbis-tools librsvg2-bin xmlstarlet doxygen graphviz libglm-dev libmpg123-dev - uses: actions/checkout@v2 - name: Create build directory run: cmake -E make_directory build diff --git a/CMakeLists.txt b/CMakeLists.txt index 5310120e..b04b6eb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,9 +216,6 @@ endif() # These are specific to GCC/MinGW/clang; for other compilers, change as necessary # The flags are used throughout src/ and test/ subdirs -# Special flags for boost -add_definitions(-DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS) - set(COLOBOT_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NORMAL_CXX_FLAGS}") set(COLOBOT_CXX_FLAGS_RELEASE "${RELEASE_CXX_FLAGS}") set(COLOBOT_CXX_FLAGS_DEBUG "${DEBUG_CXX_FLAGS}") @@ -267,9 +264,6 @@ option(USE_STATIC_RUNTIME "Link the runtime library statically" OFF) # CBot can also be a static library option(CBOT_STATIC "Build CBot as static libary" OFF) -# This is useful in case you want to use static boost libraries -option(BOOST_STATIC "Link with static boost libraries" OFF) - # This is useful on Windows, if linking against standard GLEW dll fails option(GLEW_STATIC "Link statically with GLEW" OFF) @@ -329,13 +323,6 @@ if(NOT nlohmann_json_FOUND) add_subdirectory(lib/json) endif() -set(Boost_USE_STATIC_LIBS ${BOOST_STATIC}) -set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME ${USE_STATIC_RUNTIME}) - -set(Boost_ADDITIONALVERSION "1.51" "1.51.0") -find_package(Boost COMPONENTS system regex REQUIRED) - set(GLEW_USE_STATIC_LIBS ${GLEW_STATIC}) find_package(GLEW REQUIRED) diff --git a/CMakePresets.json b/CMakePresets.json index 0741a880..9f04474b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -24,7 +24,6 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo", "USE_STATIC_RUNTIME": true, "CBOT_STATIC": true, - "BOOST_STATIC": true, "GLEW_STATIC": true, "SNDFILE_STATIC": true, "DEV_BUILD": true, diff --git a/INSTALL-MSYS2.md b/INSTALL-MSYS2.md index bc5f90d1..a8468a9a 100644 --- a/INSTALL-MSYS2.md +++ b/INSTALL-MSYS2.md @@ -110,7 +110,7 @@ Easy, isn't it? If you are lazy, you can just use this one-line command, although there is no guarantee it will work or install everything (might be out of date): ```sh -pacman -S mingw-w64-i686-boost mingw-w64-i686-glew mingw-w64-i686-libpng gettext mingw-w64-i686-gettext mingw-w64-i686-libpng mingw-w64-i686-libsndfile mingw-w64-i686-libvorbis mingw-w64-i686-libogg mingw-w64-i686-openal mingw-w64_i686-physfs mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_image mingw-w64-i686-SDL2_ttf +pacman -S mingw-w64-i686-glew mingw-w64-i686-libpng gettext mingw-w64-i686-gettext mingw-w64-i686-libpng mingw-w64-i686-libsndfile mingw-w64-i686-libvorbis mingw-w64-i686-libogg mingw-w64-i686-openal mingw-w64_i686-physfs mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_image mingw-w64-i686-SDL2_ttf ``` You should now have everything set up and working. You can close all instances of MSYS2 and autorebase to ensure everything installed properly. diff --git a/INSTALL-MacOSX.md b/INSTALL-MacOSX.md index 6d392f19..a06cee7e 100644 --- a/INSTALL-MacOSX.md +++ b/INSTALL-MacOSX.md @@ -8,7 +8,7 @@ After installing Developer Command Line Tools, you should have basic tools like ``` And then: ```bash - brew install cmake sdl2 sdl2_image sdl2_ttf boost glew physfs flac libsndfile libvorbis vorbis-tools gettext libicns librsvg wget xmlstarlet + brew install cmake sdl2 sdl2_image sdl2_ttf glew physfs flac libsndfile libvorbis vorbis-tools gettext libicns librsvg wget xmlstarlet ``` Gettext is installed in separate directory without adding the files to system path, so in order to get it working normally, you should call also: ```bash diff --git a/INSTALL.md b/INSTALL.md index 0f442ba2..91c7b922 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -46,7 +46,6 @@ you will need to compile colobot. You will need: * C++17 compiler * CMake >= 3.16 - * Boost * SDL2 * SDL2_image * SDL2_ttf @@ -62,7 +61,7 @@ You will need: On Ubuntu (and probably any other Debian-based system), you can use the following command to install all required packages: ``` - $ apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libphysfs-dev gettext git po4a vorbis-tools + $ apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsndfile1-dev libvorbis-dev libogg-dev libpng-dev libglew-dev libopenal-dev libphysfs-dev gettext git po4a vorbis-tools ``` Make sure you install the packages along with header files (often distributed in separate *-dev packages). If you miss any requirements, diff --git a/docs/using_vscode_to_compile_and_install.md b/docs/using_vscode_to_compile_and_install.md index 7e7c4e3b..baa60549 100644 --- a/docs/using_vscode_to_compile_and_install.md +++ b/docs/using_vscode_to_compile_and_install.md @@ -37,7 +37,6 @@ Create folder .vscode if there is none. Inside that folder create a file setting "inheritEnvironments": ["msvc_x64_x64"], "CMAKE_TOOLCHAIN_FILE": "input your path to the toolchain file", "VCPKG_TARGET_TRIPLET": "x64-windows-static", - "BOOST_STATIC": "1", "GLEW_STATIC": "1", "MSVC_STATIC": "1" }, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bec0bf4d..c0c5bbe2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -502,8 +502,6 @@ target_link_libraries(colobotbase PUBLIC PNG::PNG GLEW::GLEW glm::glm - Boost::headers - Boost::regex PhysFS::PhysFS SndFile::sndfile nlohmann_json::nlohmann_json diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 5e63a289..4ccd9cc7 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -5,5 +5,4 @@ add_executable(convert_model ../graphics/model/model_input.cpp ../graphics/model/model_output.cpp convert_model.cpp) -target_link_libraries(convert_model PRIVATE Boost::headers) target_include_directories(convert_model PRIVATE . ..) diff --git a/vcpkg.json b/vcpkg.json index bea7497b..adabc253 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,15 +3,6 @@ "version-string": "0.1.0", "builtin-baseline": "f6a5d4e8eb7476b8d7fc12a56dff300c1c986131", "dependencies": [ - "boost-algorithm", - "boost-bimap", - "boost-filesystem", - "boost-lexical-cast", - "boost-optional", - "boost-property-tree", - "boost-range", - "boost-regex", - "boost-system", { "name": "freetype", "default-features": false