Skip to content

Commit

Permalink
replace cotire with cmake pch (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTea authored May 1, 2024
1 parent 1900352 commit 65c1fb4
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 65c1fb4

Please sign in to comment.