Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace cotire with cmake pch #635

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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