Merge branch 'master' of git.246060.ru:f1x1t/cmlib

This commit is contained in:
Andrei Astafev 2021-07-22 14:20:22 +03:00
commit 5708fcd5e4
4 changed files with 32 additions and 5 deletions

View File

@ -4,15 +4,15 @@ function(add_common_library target)
set(oneValueArgs OUTPUT_NAME) set(oneValueArgs OUTPUT_NAME)
set(multiValueArgs SOURCES) set(multiValueArgs SOURCES)
cmake_parse_arguments(_LOCAL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) cmake_parse_arguments(_PREFIX "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(_LOCAL_OUTPUT_NAME) if(_PREFIX_OUTPUT_NAME)
set(output_name ${_LOCAL_OUTPUT_NAME}) set(output_name ${_PREFIX_OUTPUT_NAME})
else() else()
set(output_name ${target}) set(output_name ${target})
endif() endif()
add_library(${target} OBJECT ${_LOCAL_SOURCES}) add_library(${target} OBJECT ${_PREFIX_SOURCES})
target_include_directories( target_include_directories(
${target} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> ${target} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> $<INSTALL_INTERFACE:include/${target}>) $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> $<INSTALL_INTERFACE:include/${target}>)

View File

@ -4,6 +4,10 @@ if(CMAKE_BUILD_TYPE)
list(APPEND CMLIB_EXT_PROJ_DEFAULT_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) list(APPEND CMLIB_EXT_PROJ_DEFAULT_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif() endif()
if(CMLIB_MAIN_DIR)
list(APPEND CMLIB_EXT_PROJ_DEFAULT_ARGS -DCMLIB_MAIN_DIR=${CMLIB_MAIN_DIR})
endif()
if(CMAKE_C_COMPILER) if(CMAKE_C_COMPILER)
list(APPEND CMLIB_EXT_PROJ_DEFAULT_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) list(APPEND CMLIB_EXT_PROJ_DEFAULT_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
endif() endif()

View File

@ -0,0 +1,11 @@
find_package(Quadmath)
if(QUADMATH_FOUND)
add_definitions(-DHAVE_QUADMATH=1)
else()
find_package(MPFR)
if(MPFR_FOUND)
find_package(MPFRCppThirdparty)
else()
message(FATAL_ERROR "Nor Quadmath, nor MPFR found.")
endif()
endif()

View File

@ -3707,7 +3707,7 @@ if (CMAKE_SCRIPT_MODE_FILE)
COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}" COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
LANGUAGE "${COTIRE_TARGET_LANGUAGE}" LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
IGNORE_PATH "${COTIRE_TARGET_IGNORE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH}" IGNORE_PATH "${COTIRE_TARGET_IGNORE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH}"
INCLUDE_PATH ${COTIRE_TARGET_INCLUDE_PATH} INCLUDE_PATH "${COTIRE_TARGET_INCLUDE_PATH};${COTIRE_ADDITIONAL_PREFIX_HEADER_INCLUDE_PATH}"
IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}" IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}"
INCLUDE_PRIORITY_PATH ${COTIRE_TARGET_INCLUDE_PRIORITY_PATH} INCLUDE_PRIORITY_PATH ${COTIRE_TARGET_INCLUDE_PRIORITY_PATH}
INCLUDE_DIRECTORIES ${_includeDirs} INCLUDE_DIRECTORIES ${_includeDirs}
@ -3808,6 +3808,9 @@ else()
set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH "" CACHE STRING set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH "" CACHE STRING
"Ignore headers from these directories when generating the prefix header.") "Ignore headers from these directories when generating the prefix header.")
set (COTIRE_ADDITIONAL_PREFIX_HEADER_INCLUDE_PATH "" CACHE STRING
"Include headers from these directories when generating the prefix header.")
set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
"Ignore sources with the listed file extensions from the generated unity source.") "Ignore sources with the listed file extensions from the generated unity source.")
@ -3884,6 +3887,15 @@ else()
"If not defined, defaults to empty list." "If not defined, defaults to empty list."
) )
define_property(
CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_INCLUDE_PATH"
BRIEF_DOCS "Include headers from these directories when generating the prefix header."
FULL_DOCS
"The variable can be set to a semicolon separated list of include directories."
"If a header file is found in one of these directories or sub-directories, it will be included in the generated prefix header."
"If not defined, defaults to empty list."
)
define_property( define_property(
CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS" CACHED_VARIABLE PROPERTY "COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS"
BRIEF_DOCS "Ignore includes with the listed file extensions from the generated prefix header." BRIEF_DOCS "Ignore includes with the listed file extensions from the generated prefix header."