CMake: check if the compiler supports using precompiled headers
Build the cotire test project and check if it succeeds. Also check if the 'had text segment at different address' warning does not appear in the build output. If it does not succeed, disable usage of precompiled headers. If the PCH option was changed, clean the project and rebuild it again. Do not clean everytime the project is configured because (re)building the cotire test project takes some time.
This commit is contained in:
21
build/cmake/modules/cotire_test/CMakeLists.txt
Normal file
21
build/cmake/modules/cotire_test/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# cotire example project
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
if (POLICY CMP0058)
|
||||
# Ninja requires custom command byproducts to be explicit
|
||||
cmake_policy(SET CMP0058 NEW)
|
||||
endif()
|
||||
|
||||
project (CotireExample)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/..")
|
||||
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.1.0")
|
||||
set (CMAKE_CXX_STANDARD "98")
|
||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
include(cotire)
|
||||
|
||||
add_subdirectory(src)
|
Reference in New Issue
Block a user