Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
+122
@@ -0,0 +1,122 @@
|
||||
set(installation_path "${CMAKE_CURRENT_BINARY_DIR}/installation/")
|
||||
|
||||
macro(add_generate_export_header_library_test _exclude_deprecated_before_and_at)
|
||||
if("${ARGV1}" STREQUAL "WITH_GROUP")
|
||||
set(_set_group_option "-DSET_GROUP=TRUE")
|
||||
set(_library_buildname "library-${_exclude_deprecated_before_and_at}-group")
|
||||
else()
|
||||
set(_library_buildname "library-${_exclude_deprecated_before_and_at}")
|
||||
endif()
|
||||
add_test(NAME ecm_generate_export_header-build-${_library_buildname}
|
||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/library"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${_library_buildname}"
|
||||
--build-two-config
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-project library
|
||||
--build-target install
|
||||
--build-options
|
||||
"-DEXCLUDE_DEPRECATED_BEFORE_AND_AT=${_exclude_deprecated_before_and_at}"
|
||||
"-DCMAKE_INSTALL_PREFIX:PATH=${installation_path}/${_library_buildname}"
|
||||
${_set_group_option}
|
||||
--test-command dummy
|
||||
)
|
||||
endmacro()
|
||||
|
||||
macro(add_generate_export_header_consumer_test _test_variant _exclude_deprecated_before_and_at _group_test_mode _consumer_build)
|
||||
set(_extra_build_options ${ARGN})
|
||||
if(_group_test_mode STREQUAL "GROUPLESS")
|
||||
set(_library "library-${_exclude_deprecated_before_and_at}")
|
||||
else()
|
||||
set(_library "library-${_exclude_deprecated_before_and_at}-group")
|
||||
endif()
|
||||
add_test(NAME ecm_generate_export_header-${_consumer_build}
|
||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/consumer"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${_consumer_build}"
|
||||
--build-two-config
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-project consumer
|
||||
--build-options
|
||||
"-DTEST_VARIANT:STRING=${_test_variant}"
|
||||
"-DDEPRECATED_EXCLUDED_BEFORE_AND_AT:STRING=${_exclude_deprecated_before_and_at}"
|
||||
"-DLIBRARY:STRING=${_library}"
|
||||
"-DGROUP_MODE:STRING=${_group_test_mode}"
|
||||
${_extra_build_options}
|
||||
--test-command dummy
|
||||
)
|
||||
set_tests_properties(ecm_generate_export_header-${_consumer_build}
|
||||
PROPERTIES DEPENDS "ecm_generate_export_header-build-${_library}")
|
||||
endmacro()
|
||||
|
||||
macro(add_generate_export_header_consumer_disable_deprecated_before_and_at_test
|
||||
_disable_deprecated_before_and_at
|
||||
_exclude_deprecated_before_and_at
|
||||
_group_test_mode
|
||||
)
|
||||
set(_consumer_build "consumer-${_disable_deprecated_before_and_at}-${_exclude_deprecated_before_and_at}-${_group_test_mode}")
|
||||
set(_extra_build_options
|
||||
"-DLIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT:STRING=${_disable_deprecated_before_and_at}"
|
||||
)
|
||||
add_generate_export_header_consumer_test(DISABLE_DEPRECATED_BEFORE_AND_AT
|
||||
${_exclude_deprecated_before_and_at}
|
||||
${_group_test_mode}
|
||||
${_consumer_build}
|
||||
${_extra_build_options}
|
||||
)
|
||||
endmacro()
|
||||
|
||||
macro(add_generate_export_header_consumer_no_deprecated_test _exclude_deprecated_before_and_at _group_test_mode)
|
||||
set(_consumer_build "consumer-NO-DEPRECATED-${_exclude_deprecated_before_and_at}-${_group_test_mode}")
|
||||
add_generate_export_header_consumer_test(NO_DEPRECATED
|
||||
${_exclude_deprecated_before_and_at}
|
||||
${_group_test_mode}
|
||||
${_consumer_build}
|
||||
)
|
||||
endmacro()
|
||||
|
||||
# prepare list of versions
|
||||
set(library_versions 0 2.0.0 CURRENT)
|
||||
list(LENGTH library_versions library_versions_count)
|
||||
math(EXPR _last_index ${library_versions_count}-1)
|
||||
|
||||
# test generating the library with different EXCLUDE_DEPRECATED_BEFORE_AND_AT values
|
||||
# also install the generated libraries together incl. exported cmake targets, for use in tests below
|
||||
# TODO: wariant with DEPRECATED_BASE_VERSION
|
||||
foreach(_group_arg "" "WITH_GROUP")
|
||||
foreach(_index RANGE ${_last_index})
|
||||
list(GET library_versions ${_index} _exclude_deprecated_before_and_at)
|
||||
add_generate_export_header_library_test(${_exclude_deprecated_before_and_at} ${_group_arg})
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
|
||||
set(group_test_modes "GROUPLESS" "GROUP_USE_DIRECT" "GROUP_USE_GROUP")
|
||||
|
||||
# test using the library, built with different EXCLUDE_DEPRECATED_BEFORE_AND_AT values,
|
||||
# while using different DISABLE_DEPRECATED_BEFORE_AND_AT values
|
||||
# TODO: test DEPRECATED_WARNINGS_SINCE
|
||||
foreach(_group_test_mode ${group_test_modes})
|
||||
foreach(_exclude_index RANGE ${_last_index})
|
||||
list(GET library_versions ${_exclude_index} _exclude_deprecated_before_and_at)
|
||||
# using disabled API limit below the excluded API limit is not supported and
|
||||
# caught by the code generated from the ecm_generate_export_header,
|
||||
# so testing those combination will not work, so start from the excluded API limit
|
||||
foreach(_disable_index RANGE ${_exclude_index} ${_last_index})
|
||||
list(GET library_versions ${_disable_index} _disable_deprecated_before_and_at)
|
||||
add_generate_export_header_consumer_disable_deprecated_before_and_at_test(${_disable_deprecated_before_and_at} ${_exclude_deprecated_before_and_at} ${_group_test_mode})
|
||||
endforeach()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# test with NO_DEPRECATED
|
||||
foreach(_group_test_mode ${group_test_modes})
|
||||
foreach(_exclude_index RANGE ${_last_index})
|
||||
list(GET library_versions ${_exclude_index} _exclude_deprecated_before_and_at)
|
||||
add_generate_export_header_consumer_no_deprecated_test(${_exclude_deprecated_before_and_at} ${_group_test_mode})
|
||||
endforeach()
|
||||
endforeach()
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
|
||||
project(consumer)
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
include(../../test_helpers.cmake)
|
||||
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/../installation/${LIBRARY}/lib/library/LibraryTargets.cmake")
|
||||
|
||||
# map any "CURRENT" value to library version string
|
||||
# keep version in sync with the one used in library/CMakeLists.txt
|
||||
set(library_version 2.40.0)
|
||||
if(LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT")
|
||||
set(LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT ${library_version})
|
||||
endif()
|
||||
if(DEPRECATED_EXCLUDED_BEFORE_AND_AT STREQUAL "CURRENT")
|
||||
set(DEPRECATED_EXCLUDED_BEFORE_AND_AT ${library_version})
|
||||
endif()
|
||||
|
||||
# load the test variant specific testAPI method
|
||||
include(testAPI_${TEST_VARIANT}.cmake)
|
||||
|
||||
# for each API element test their visibility to the compiler and if a warning is emitted
|
||||
set(_code "Enum enumerator = Enumerator_deprecatedAt2_0;")
|
||||
testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 11 BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
|
||||
|
||||
set(_code "Enum enumerator = Enumerator_deprecatedAt2_0;")
|
||||
# we do not yet support enumerator warnings with MSVC
|
||||
if(MSVC)
|
||||
testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 17 BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
|
||||
else()
|
||||
testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 17 BUILD_TIME_ONLY_DISABLABLE)
|
||||
endif()
|
||||
|
||||
set(_code "Enum enumerator = Enumerator_deprecatedAt2_12;")
|
||||
testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 11 NO_WARNING)
|
||||
|
||||
set(_code "Enum enumerator = Enumerator_deprecatedAt2_12;")
|
||||
# we do not yet support enumerator warnings with MSVC
|
||||
if(MSVC)
|
||||
testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 17 NO_WARNING)
|
||||
else()
|
||||
testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
set(_code "Enum enumerator = Enumerator_not_deprecated;")
|
||||
testAPI(_code)
|
||||
|
||||
set(_code "function_deprecatedAt2_0();")
|
||||
testAPI(_code DEPRECATED_AT 2.0)
|
||||
|
||||
set(_code "function_deprecatedAt2_12();")
|
||||
testAPI(_code DEPRECATED_AT 2.12)
|
||||
|
||||
set(_code "function_not_deprecated();")
|
||||
testAPI(_code)
|
||||
|
||||
set(_code "Class().method_deprecatedAt2_0();")
|
||||
testAPI(_code DEPRECATED_AT 2.0 BUILD_TIME_ONLY_DISABLABLE)
|
||||
|
||||
set(_code "Class().method_deprecatedAt2_12();")
|
||||
testAPI(_code DEPRECATED_AT 2.12 BUILD_TIME_ONLY_DISABLABLE)
|
||||
|
||||
set(_code "Class().method_not_deprecated();")
|
||||
testAPI(_code)
|
||||
|
||||
add_executable(dummy main.cpp)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
function(generate_hex_number _var_name _version)
|
||||
set(_hexnumber 0)
|
||||
|
||||
set(version_regex "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
|
||||
string(REGEX REPLACE ${version_regex} "\\1" _version_major "${_version}")
|
||||
string(REGEX REPLACE ${version_regex} "\\2" _version_minor "${_version}")
|
||||
string(REGEX REPLACE ${version_regex} "\\3" _version_patch "${_version}")
|
||||
set(_outputformat)
|
||||
set(_outputformat OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR _hexnumber "${_version_major}*65536 + ${_version_minor}*256 + ${_version_patch}" ${_outputformat})
|
||||
set(${_var_name} ${_hexnumber} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
generate_hex_number(disable_deprecated_before_and_at_hexnumber ${LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT})
|
||||
|
||||
if(GROUP_MODE STREQUAL "GROUP_USE_GROUP")
|
||||
set(_deprecation_macros_base_name "LIBGROUP")
|
||||
else()
|
||||
set(_deprecation_macros_base_name "LIBRARY")
|
||||
endif()
|
||||
|
||||
function(testAPI code_var_name)
|
||||
set(options BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
|
||||
set(oneValueArgs DEPRECATED_AT CXX_STANDARD)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if((NOT ARGS_DEPRECATED_AT) OR
|
||||
(ARGS_BUILD_TIME_ONLY_DISABLABLE AND ARGS_DEPRECATED_AT VERSION_GREATER DEPRECATED_EXCLUDED_BEFORE_AND_AT) OR
|
||||
(ARGS_DEPRECATED_AT VERSION_GREATER LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT))
|
||||
set(_build_result_expected TRUE)
|
||||
else()
|
||||
set(_build_result_expected FALSE)
|
||||
endif()
|
||||
|
||||
if (ARGS_CXX_STANDARD)
|
||||
if(MSVC)
|
||||
# C++11 is default for MSVC, no /std:c++11 flag available to set
|
||||
if (NOT ARGS_CXX_STANDARD STREQUAL "11")
|
||||
set(std_flag "/std:c++${ARGS_CXX_STANDARD}")
|
||||
endif()
|
||||
else()
|
||||
set(std_flag "-std=c++${ARGS_CXX_STANDARD}")
|
||||
endif()
|
||||
else()
|
||||
set(std_flag)
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${std_flag}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES library)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-D${_deprecation_macros_base_name}_DISABLE_DEPRECATED_BEFORE_AND_AT=${disable_deprecated_before_and_at_hexnumber}")
|
||||
|
||||
set(_code "
|
||||
#include <library.hpp>
|
||||
int main(int, char**)
|
||||
{
|
||||
${${code_var_name}}
|
||||
}
|
||||
")
|
||||
|
||||
unset(_result CACHE) # clear out as check_cxx_source_compiles caches the result
|
||||
check_cxx_source_compiles("${_code}" _result)
|
||||
|
||||
assert_var_bool_value(_result ${_build_result_expected})
|
||||
|
||||
# check warning
|
||||
if(_build_result_expected)
|
||||
if(NOT ARGS_NO_WARNING AND
|
||||
((ARGS_BUILD_TIME_ONLY_DISABLABLE) OR
|
||||
(NOT ARGS_BUILD_TIME_ONLY_DISABLABLE AND ARGS_DEPRECATED_AT AND
|
||||
ARGS_DEPRECATED_AT VERSION_GREATER LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT)))
|
||||
set(_dep_warning_as_error_result_expected FALSE)
|
||||
else()
|
||||
set(_dep_warning_as_error_result_expected TRUE)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# warning C4996 warns about deprecated declarations
|
||||
set(dep_warning_as_error_flag "-we4996")
|
||||
else()
|
||||
set(dep_warning_as_error_flag "-Werror=deprecated-declarations")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${std_flag} ${dep_warning_as_error_flag}")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # unset LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT, as LIBRARY_DEPRECATED_WARNINGS_SINCE defaults to it
|
||||
unset(_dep_warning_result CACHE) # clear out as check_cxx_source_compiles caches the result
|
||||
check_cxx_source_compiles("${_code}" _dep_warning_result)
|
||||
assert_var_bool_value(_dep_warning_result ${_dep_warning_as_error_result_expected})
|
||||
endif()
|
||||
endfunction()
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
if(GROUP_MODE STREQUAL "GROUP_USE_GROUP")
|
||||
set(_deprecation_macros_base_name "LIBGROUP")
|
||||
else()
|
||||
set(_deprecation_macros_base_name "LIBRARY")
|
||||
endif()
|
||||
|
||||
function(testAPI code_var_name)
|
||||
set(options BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
|
||||
set(oneValueArgs DEPRECATED_AT CXX_STANDARD)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if((NOT ARGS_DEPRECATED_AT) OR
|
||||
(ARGS_BUILD_TIME_ONLY_DISABLABLE AND ARGS_DEPRECATED_AT VERSION_GREATER DEPRECATED_EXCLUDED_BEFORE_AND_AT))
|
||||
set(_build_result_expected TRUE)
|
||||
else()
|
||||
set(_build_result_expected FALSE)
|
||||
endif()
|
||||
|
||||
if (ARGS_CXX_STANDARD)
|
||||
if(MSVC)
|
||||
# C++11 is default for MSVC, no /std:c++11 flag available to set
|
||||
if (NOT ARGS_CXX_STANDARD STREQUAL "11")
|
||||
set(std_flag "/std:c++${ARGS_CXX_STANDARD}")
|
||||
endif()
|
||||
else()
|
||||
set(std_flag "-std=c++${ARGS_CXX_STANDARD}")
|
||||
endif()
|
||||
else()
|
||||
set(std_flag)
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${std_flag}")
|
||||
set(CMAKE_REQUIRED_LIBRARIES library)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-D${_deprecation_macros_base_name}_NO_DEPRECATED")
|
||||
|
||||
set(_code "
|
||||
#include <library.hpp>
|
||||
int main(int, char**)
|
||||
{
|
||||
${${code_var_name}}
|
||||
}
|
||||
")
|
||||
|
||||
unset(_result CACHE) # clear out as check_cxx_source_compiles caches the result
|
||||
check_cxx_source_compiles("${_code}" _result)
|
||||
|
||||
assert_var_bool_value(_result ${_build_result_expected})
|
||||
|
||||
# check warning
|
||||
if(_build_result_expected)
|
||||
if(ARGS_BUILD_TIME_ONLY_DISABLABLE AND NOT ARGS_NO_WARNING)
|
||||
set(_dep_warning_as_error_result_expected FALSE)
|
||||
else()
|
||||
set(_dep_warning_as_error_result_expected TRUE)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# warning C4996 warns about deprecated declarations
|
||||
set(dep_warning_as_error_flag "-we4996")
|
||||
else()
|
||||
set(dep_warning_as_error_flag "-Werror=deprecated-declarations")
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${std_flag} ${dep_warning_as_error_flag}")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # unset LIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT, as LIBRARY_DEPRECATED_WARNINGS_SINCE defaults to it
|
||||
unset(_dep_warning_result CACHE) # clear out as check_cxx_source_compiles caches the result
|
||||
check_cxx_source_compiles("${_code}" _dep_warning_result)
|
||||
assert_var_bool_value(_dep_warning_result ${_dep_warning_as_error_result_expected})
|
||||
endif()
|
||||
endfunction()
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
|
||||
project(format_version)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
|
||||
include(ECMGenerateExportHeader)
|
||||
|
||||
include(../../test_helpers.cmake)
|
||||
|
||||
set(_current_version "4.5.6")
|
||||
|
||||
# check 0: with CURRENT_VERSION
|
||||
ecm_export_header_format_version(0
|
||||
CURRENT_VERSION ${_current_version}
|
||||
STRING_VAR _versionstring
|
||||
HEXNUMBER_VAR _hexnumber
|
||||
)
|
||||
|
||||
assert_var_str_value(_versionstring "0")
|
||||
assert_var_str_value(_hexnumber "0")
|
||||
|
||||
# check 0: no CURRENT_VERSION
|
||||
ecm_export_header_format_version(0
|
||||
STRING_VAR _versionstring
|
||||
HEXNUMBER_VAR _hexnumber
|
||||
)
|
||||
|
||||
assert_var_str_value(_versionstring "0")
|
||||
assert_var_str_value(_hexnumber "0")
|
||||
|
||||
# check some version: with CURRENT_VERSION
|
||||
ecm_export_header_format_version(1.2.3
|
||||
CURRENT_VERSION ${_current_version}
|
||||
STRING_VAR _versionstring
|
||||
HEXNUMBER_VAR _hexnumber
|
||||
)
|
||||
|
||||
assert_var_str_value(_versionstring "1.2.3")
|
||||
assert_var_str_value(_hexnumber "0x10203")
|
||||
|
||||
# check some version: no CURRENT_VERSION
|
||||
ecm_export_header_format_version(1.2.3
|
||||
STRING_VAR _versionstring
|
||||
HEXNUMBER_VAR _hexnumber
|
||||
)
|
||||
|
||||
assert_var_str_value(_versionstring "1.2.3")
|
||||
assert_var_str_value(_hexnumber "0x10203")
|
||||
|
||||
# check CURRENT
|
||||
ecm_export_header_format_version(CURRENT
|
||||
CURRENT_VERSION ${_current_version}
|
||||
STRING_VAR _versionstring
|
||||
HEXNUMBER_VAR _hexnumber
|
||||
)
|
||||
|
||||
assert_var_str_value(_versionstring "4.5.6")
|
||||
assert_var_str_value(_hexnumber "0x40506")
|
||||
|
||||
add_executable(dummy main.cpp)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
|
||||
# keep version in sync with the one used in consumer/CMakeLists.txt for the library
|
||||
# ideally would be send over by an exported target property,
|
||||
# but exporting custom properties via EXPORT_PROPERTIES only was added in CMake 3.12
|
||||
project(library VERSION 2.40.0)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
|
||||
include(ECMGenerateExportHeader)
|
||||
|
||||
set(_public_includedir "include/library")
|
||||
|
||||
add_library(library library.cpp)
|
||||
target_include_directories(library
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
|
||||
"$<INSTALL_INTERFACE:${_public_includedir}>"
|
||||
)
|
||||
|
||||
if(SET_GROUP)
|
||||
set(_group_args GROUP_BASE_NAME LIBGROUP)
|
||||
endif()
|
||||
|
||||
ecm_generate_export_header(library
|
||||
${_group_args}
|
||||
VERSION ${library_VERSION}
|
||||
DEPRECATION_VERSIONS 2.0 2.12
|
||||
EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
|
||||
)
|
||||
|
||||
install(TARGETS library DESTINATION lib EXPORT library_targets)
|
||||
|
||||
install(EXPORT library_targets FILE LibraryTargets.cmake DESTINATION lib/library)
|
||||
install(FILES
|
||||
library.hpp
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/library_export.h"
|
||||
DESTINATION ${_public_includedir}
|
||||
)
|
||||
|
||||
add_executable(dummy main.cpp)
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
#include "library.hpp"
|
||||
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0)
|
||||
void function_deprecatedAt2_0()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 12)
|
||||
void function_deprecatedAt2_12()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void function_not_deprecated()
|
||||
{
|
||||
}
|
||||
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0)
|
||||
void Class::method_deprecatedAt2_0()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 12)
|
||||
void Class::method_deprecatedAt2_12()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void Class::method_not_deprecated()
|
||||
{
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
#include <library_export.h>
|
||||
|
||||
enum Enum {
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0)
|
||||
Enumerator_deprecatedAt2_0 LIBRARY_ENUMERATOR_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0"),
|
||||
#endif
|
||||
Enumerator_not_deprecated,
|
||||
#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 12)
|
||||
Enumerator_deprecatedAt2_12 LIBRARY_ENUMERATOR_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12"),
|
||||
#endif
|
||||
};
|
||||
|
||||
#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 0)
|
||||
LIBRARY_EXPORT
|
||||
LIBRARY_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0")
|
||||
void function_deprecatedAt2_0();
|
||||
#endif
|
||||
|
||||
#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 12)
|
||||
LIBRARY_EXPORT
|
||||
LIBRARY_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12")
|
||||
void function_deprecatedAt2_12();
|
||||
#endif
|
||||
|
||||
LIBRARY_EXPORT void function_not_deprecated();
|
||||
|
||||
class LIBRARY_EXPORT Class {
|
||||
public:
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0)
|
||||
LIBRARY_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0")
|
||||
virtual void method_deprecatedAt2_0();
|
||||
#endif
|
||||
|
||||
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 12)
|
||||
LIBRARY_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12")
|
||||
virtual void method_deprecatedAt2_12();
|
||||
#endif
|
||||
|
||||
virtual void method_not_deprecated();
|
||||
};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user