CMake: Remove cotire dependency

CMake now has native unity build support:
https://cmake.org/cmake/help/latest/variable/CMAKE_UNITY_BUILD.html
This commit is contained in:
Dennis Klein 2021-05-25 21:52:41 +02:00 committed by Dennis Klein
parent d15bc17b12
commit ed78ccd29c
4 changed files with 10 additions and 4258 deletions

View File

@ -45,8 +45,6 @@ fairmq_build_option(BUILD_SDK "Build the FairMQ controller SDK."
DEFAULT OFF REQUIRES "BUILD_DDS_PLUGIN;BUILD_SDK_COMMANDS") DEFAULT OFF REQUIRES "BUILD_DDS_PLUGIN;BUILD_SDK_COMMANDS")
fairmq_build_option(BUILD_DOCS "Build FairMQ documentation." fairmq_build_option(BUILD_DOCS "Build FairMQ documentation."
DEFAULT OFF) DEFAULT OFF)
fairmq_build_option(FAST_BUILD "Fast production build. Not recommended for development."
DEFAULT OFF)
fairmq_build_option(USE_EXTERNAL_GTEST "Do not use bundled GTest. Not recommended." fairmq_build_option(USE_EXTERNAL_GTEST "Do not use bundled GTest. Not recommended."
DEFAULT OFF) DEFAULT OFF)
fairmq_build_option(FAIRMQ_DEBUG_MODE "Compile in debug mode (may decrease performance)." fairmq_build_option(FAIRMQ_DEBUG_MODE "Compile in debug mode (may decrease performance)."
@ -55,10 +53,6 @@ fairmq_build_option(FAIRMQ_DEBUG_MODE "Compile in debug mode (may decrease per
# Dependencies ################################################################# # Dependencies #################################################################
if(FAST_BUILD)
include(cotire)
endif()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)

View File

@ -11,10 +11,6 @@ Comment: The copyright of individual contributors is documented in the
Git history. Git history.
License: LGPL-3.0-only License: LGPL-3.0-only
Files: cmake/cotire.cmake
Copyright: 2012-2018 Sascha Kratky
License: COTIRE
Files: extern/googletest Files: extern/googletest
Copyright: 2008, Google Inc. Copyright: 2008, Google Inc.
License: GOOGLE License: GOOGLE
@ -30,28 +26,6 @@ License: MIT
License: LGPL-3.0-only License: LGPL-3.0-only
[see LICENSE file] [see LICENSE file]
License: COTIRE
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
License: GOOGLE License: GOOGLE
Copyright 2008, Google Inc. Copyright 2008, Google Inc.
All rights reserved. All rights reserved.

File diff suppressed because it is too large Load Diff

View File

@ -257,39 +257,32 @@ if(BUILD_FAIRMQ)
################################# #################################
# define libFairMQ build target # # define libFairMQ build target #
################################# #################################
if(FAST_BUILD) set(target FairMQ)
set(_target FairMQ_) add_library(${target}
else()
set(_target FairMQ)
endif()
add_library(${_target}
${FAIRMQ_SOURCE_FILES} ${FAIRMQ_SOURCE_FILES}
${FAIRMQ_PUBLIC_HEADER_FILES} # for IDE integration ${FAIRMQ_PUBLIC_HEADER_FILES} # for IDE integration
${FAIRMQ_PRIVATE_HEADER_FILES} # for IDE integration ${FAIRMQ_PRIVATE_HEADER_FILES} # for IDE integration
) )
set_target_properties(${_target} PROPERTIES LABELS coverage) set_target_properties(${target} PROPERTIES LABELS coverage)
if(FAST_BUILD)
set_target_properties(${_target} PROPERTIES OUTPUT_NAME FairMQ)
endif()
############################ ############################
# preprocessor definitions # # preprocessor definitions #
############################ ############################
target_compile_definitions(${_target} PUBLIC BOOST_ERROR_CODE_HEADER_ONLY) target_compile_definitions(${target} PUBLIC BOOST_ERROR_CODE_HEADER_ONLY)
if(FAIRMQ_DEBUG_MODE) if(FAIRMQ_DEBUG_MODE)
target_compile_definitions(${_target} PUBLIC FAIRMQ_DEBUG_MODE) target_compile_definitions(${target} PUBLIC FAIRMQ_DEBUG_MODE)
endif() endif()
if(BUILD_OFI_TRANSPORT) if(BUILD_OFI_TRANSPORT)
target_compile_definitions(${_target} PRIVATE BUILD_OFI_TRANSPORT) target_compile_definitions(${target} PRIVATE BUILD_OFI_TRANSPORT)
endif() endif()
target_compile_definitions(${_target} PUBLIC FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM}) target_compile_definitions(${target} PUBLIC FAIRMQ_HAS_STD_FILESYSTEM=${FAIRMQ_HAS_STD_FILESYSTEM})
####################### #######################
# include directories # # include directories #
####################### #######################
target_include_directories(${_target} target_include_directories(${target}
PUBLIC # consumers inherit public include directories PUBLIC # consumers inherit public include directories
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
@ -307,12 +300,8 @@ if(BUILD_FAIRMQ)
Boost::container Boost::container
) )
endif() endif()
set(optional_deps ${OFI_DEPS})
if(optional_deps)
list(REMOVE_DUPLICATES optional_deps)
endif()
target_link_libraries(${_target} target_link_libraries(${target}
INTERFACE # only consumers link against interface dependencies INTERFACE # only consumers link against interface dependencies
Boost::container Boost::container
@ -333,27 +322,12 @@ if(BUILD_FAIRMQ)
PicoSHA2 PicoSHA2
${OFI_DEPS} ${OFI_DEPS}
) )
set_target_properties(${_target} PROPERTIES set_target_properties(${target} PROPERTIES
VERSION ${PROJECT_VERSION} VERSION ${PROJECT_VERSION}
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
) )
##############
# fast build #
##############
if(FAST_BUILD)
set_target_properties(${_target} PROPERTIES
COTIRE_UNITY_TARGET_NAME "FairMQ"
# COTIRE_ENABLE_PRECOMPILED_HEADER FALSE
EXCLUDE_FROM_ALL TRUE
)
cotire(${_target})
set_target_properties(FairMQ PROPERTIES EXCLUDE_FROM_ALL FALSE)
set_target_properties(FairMQ PROPERTIES LABELS coverage)
endif()
############### ###############
# executables # # executables #
############### ###############