From 65c1fb44af26889661f7327dcd5f502e10bd5a70 Mon Sep 17 00:00:00 2001 From: Jason Gauci Date: Wed, 1 May 2024 14:05:15 -0400 Subject: [PATCH] replace cotire with cmake pch (#635) --- CMakeLists.txt | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71b98a326..716254e2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.16.3) set(EXTERNAL_DIR "${CMAKE_SOURCE_DIR}/external") @@ -80,13 +80,6 @@ message(STATUS "VCPKG TRIPLET: ${VCPKG_TARGET_TRIPLET}") # Don't specify languages yet in case we need to bump the cmake version project(EternalTCP VERSION 6.2.8 LANGUAGES NONE) -if(WIN32) - message(STATUS "Windows detected. Bumping up cmake version.") - - # Hack to force a higher minimum version on windows - cmake_minimum_required(VERSION 3.15.0) -endif() - enable_language(C) enable_language(CXX) @@ -186,14 +179,6 @@ if(USE_SENTRY) endif() endif() -set(CMAKE_MODULE_PATH "${EXTERNAL_DIR}/cotire/CMake" - ${CMAKE_MODULE_PATH}) -include(cotire) - -if(POLICY CMP0058) - cmake_policy(SET CMP0058 NEW) # Needed for cotire -endif() - option(CODE_COVERAGE "Enable code coverage" OFF) option(FUZZING "Enable builds for fuzz testing" OFF) option(BUILD_TESTING "Build tests" ON) @@ -326,14 +311,7 @@ ENDIF() macro(DECORATE_TARGET TARGET_NAME) add_sanitizers(${TARGET_NAME}) - set_target_properties(${TARGET_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT - "src/base/Headers.hpp") - - if(CMAKE_CROSSCOMPILING) - # Doesn't work when cross-compiling - else() - cotire(${TARGET_NAME}) - endif() + target_precompile_headers(${TARGET_NAME} PUBLIC "src/base/Headers.hpp") endmacro() macro(DECORATE_FUZZER TARGET_NAME)