From 3520c825f48a647c2039d891a39290e754c86e86 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Fri, 27 Jan 2023 09:48:34 -0700 Subject: [PATCH] cmake: Update minimum to 3.17.2 Matches what VVL currently uses --- .github/workflows/build.yml | 36 +++++------------------------------- BUILD.md | 15 +++------------ CMakeLists.txt | 8 +------- 3 files changed, 9 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4d10613..f8d25da2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,16 +160,19 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.7' + - uses: lukka/get-cmake@latest + with: + cmakeVersion: 3.17.2 - name: Generate build files - run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}} -D${{matrix.static_build}} -DBUILD_TESTS=On -DUPDATE_DEPS=ON -DTEST_USE_ADDRESS_SANITIZER=ON + run: cmake -S. -B build -DCMAKE_BUILD_TYPE=${{matrix.config}} -D${{matrix.static_build}} -DBUILD_TESTS=ON -DUPDATE_DEPS=ON -DTEST_USE_ADDRESS_SANITIZER=ON -G "Ninja" env: # Specify the minimum version of macOS on which the target binaries are to be deployed. # https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html MACOSX_DEPLOYMENT_TARGET: 10.12 - name: Build the loader - run: make -C build + run: cmake --build build - name: Run regression tests working-directory: ./build @@ -184,7 +187,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Get depot tools run: | git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools @@ -203,31 +205,3 @@ jobs: - name: Build the loader run: ninja -C out/${{matrix.config}} - - test-cmake-minimum: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: lukka/get-cmake@latest - with: - cmakeVersion: 3.10.2 - - - name: Install Dependencies - run: sudo apt update && sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev - - - name: CMake Version - run: cmake --version - - - name: Create build directory - run: mkdir build/ - - - name: Get Dependencies - working-directory: ./build - run: python ../scripts/update_deps.py - - - name: Configure Vulkan-Loader - working-directory: ./build - run: cmake -C helper.cmake -D BUILD_TESTS=OFF -G "Ninja" ../ - - - name: Build the loader - run: cmake --build build/ diff --git a/BUILD.md b/BUILD.md index 5aaf23cd..9fc12293 100644 --- a/BUILD.md +++ b/BUILD.md @@ -296,7 +296,7 @@ cmake ... -D CMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/ccache -D CMAKE_C_COMPILER_LAU - [2017 & 2019](https://www.visualstudio.com/vs/older-downloads/) - The Community Edition of each of the above versions is sufficient, as well as any more capable edition. -- [CMake 3.10.2](https://cmake.org/files/v3.10/cmake-3.10.2-win64-x64.zip) is recommended. +- [CMake 3.17.2](https://cmake.org/files/v3.17/cmake-3.17.2-win64-x64.zip) is recommended. - Use the installer option to add CMake to the system PATH - Git Client Support - [Git for Windows](http://git-scm.com/download/win) is a popular solution @@ -434,7 +434,7 @@ that the minimum officially supported C++11 compiler version is GCC 5.4.0, although earlier versions may work. It should be straightforward to adapt this repository to other Linux distributions. -[CMake 3.10.2](https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz) is recommended. +[CMake 3.17.2](https://cmake.org/files/v3.17/cmake-3.17.2-Linux-x86_64.tar.gz) is recommended. #### Required Package List @@ -638,16 +638,7 @@ Clone the Vulkan-ValidationLayers repository: ### MacOS build -[CMake 3.10.2](https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz) is recommended. - -#### CMake Generators - -This repository uses CMake to generate build or project files that are then -used to build the repository. The CMake generators explicitly supported in -this repository are: - -- Unix Makefiles -- Xcode +[CMake 3.17.2](https://cmake.org/files/v3.17/cmake-3.17.2-Darwin-x86_64.tar.gz) is recommended. #### Building with the Unix Makefiles Generator diff --git a/CMakeLists.txt b/CMakeLists.txt index 9dea5366..647d5d71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ~~~ -cmake_minimum_required(VERSION 3.10.2) +cmake_minimum_required(VERSION 3.17.2) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") project(Vulkan-Loader) @@ -157,12 +157,6 @@ if(UNIX) "System-wide search directory. If not set or empty, CMAKE_INSTALL_FULL_SYSCONFDIR and /etc are used.") endif() -# Because we use CMake 3.10.2, we can't use the policy which would disable adding /W3 by default. In the interim, replace the flags -# When this project is updated to 3.15 and above, use the following line. -# cmake_policy(SET CMP0092 NEW) -string(REGEX REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -string(REGEX REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - # For MSVC/Windows, replace /GR with an empty string, this prevents warnings of /GR being overriden by /GR- # Newer CMake versions (3.20) have better solutions for this through policy - using the old # way while waiting for when updating can occur -- 2.34.1