|
40 | 40 | # Default=false (build shared and static libs) |
41 | 41 | # Takes precedence over STATIC_ONLY |
42 | 42 | # |
43 | | -# -DENABLE_LTO_BUILD=[true|false] |
44 | | -# Build a link-time optimized version (requires gcc or clang) |
45 | | -# Default=false (do not build a link time optimized version) |
46 | | -# |
47 | 43 | # -DGOBJECT_INTROSPECTION=[true|false] |
48 | 44 | # Set to build GObject introspection "typelib" files |
49 | 45 | # Requires GObject Introspection development package (version MIN_GOBJECT_INTROSPECTION) |
|
69 | 65 | # Requires gi-docgen, GOBJECT_INTROSPECTION and LIBICAL_BUILD_DOCS options to be true. |
70 | 66 | # Default=true (build libical-glib developer documentation) |
71 | 67 | # |
| 68 | +# -DLIBICAL_GLIB_CHECK_API_FILES=[true|false] |
| 69 | +# Set to check whether API files for the libical-glib contain all symbols exported |
| 70 | +# in the corresponding header files; requires ICAL_GLIB to be set to True |
| 71 | +# Default=false (always true if LIBICAL_DEVMODE is on) |
| 72 | +# |
72 | 73 | # -DLIBICAL_ENABLE_MSVC_32BIT_TIME_T=[true|false] |
73 | 74 | # Set to build using a 32bit time_t (ignored unless building with MSVC on Windows) |
74 | 75 | # Default=false (use the default size of time_t) |
|
133 | 134 | # Build with the undefined sanitizer (requires gcc or clang) |
134 | 135 | # Default=false |
135 | 136 | # |
136 | | -# -DLIBICAL_SYNCMODE_THREADLOCAL=[true|false] |
137 | | -# Experimental: If set to true, global variables are marked as thread-local. This allows accessing |
138 | | -# libical from multiple threads without the need for synchronization. However, any global settings |
| 137 | +# -DLIBICAL_DEVMODE_SYNCMODE_THREADLOCAL=[true|false] |
| 138 | +# If set to true, global variables are marked as thread-local. This allows accessing libical |
| 139 | +# from multiple threads without the need for synchronization. However, any global settings |
139 | 140 | # must be applied per thread. Note that in this mode, any global variables and cached data are |
140 | 141 | # allocated per thread, including the cache for the built-in timezone data. This can lead to a |
141 | 142 | # significant overhead in memory usage and initialization time. It's therefore recommended to limit |
@@ -748,6 +749,11 @@ if(LIBICAL_GLIB) |
748 | 749 | ) |
749 | 750 | endif() |
750 | 751 | endif() |
| 752 | +libical_option(LIBICAL_GLIB_CHECK_API_FILES "Check libical-glib API files for completeness." False) |
| 753 | +# Always check the API files in developer-mode (when libical-glib is enabled) |
| 754 | +if(LIBICAL_DEVMODE) |
| 755 | + set(LIBICAL_GLIB_CHECK_API_FILES True) |
| 756 | +endif() |
751 | 757 | # LIBICAL_GLIB_BUILD_DOCS might be disabled later by some devmode options |
752 | 758 | libical_deprecated_option(ICAL_GLIB_BUILD_DOCS LIBICAL_GLIB_BUILD_DOCS "Build libical-glib documentation" True) |
753 | 759 |
|
@@ -971,32 +977,24 @@ if(LIBICAL_DEVMODE_UNDEFINED_SANITIZER) |
971 | 977 | endif() |
972 | 978 | endif() |
973 | 979 |
|
974 | | -mark_as_advanced(LIBICAL_SYNCMODE_THREADLOCAL) |
975 | | -libical_option(LIBICAL_SYNCMODE_THREADLOCAL "Experimental: Mark global variables as thread-local." False) |
| 980 | +mark_as_advanced(LIBICAL_DEVMODE_SYNCMODE_THREADLOCAL) |
| 981 | +libical_deprecated_option( |
| 982 | + LIBICAL_SYNCMODE_THREADLOCAL |
| 983 | + LIBICAL_DEVMODE_SYNCMODE_THREADLOCAL |
| 984 | + "Mark global variables as thread-local." |
| 985 | + False |
| 986 | +) |
976 | 987 |
|
977 | | -libical_option(ENABLE_LTO_BUILD "Build a link-time optimized version." False) |
978 | | -if(ENABLE_LTO_BUILD) |
979 | | - if(CMAKE_C_COMPILER_IS_GCC) |
980 | | - libical_add_cflag(-flto LTO) |
981 | | - if(C_SUPPORTS_LTO) |
982 | | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wlto-type-mismatch -fuse-linker-plugin") |
983 | | - set(CMAKE_AR "gcc-ar") |
984 | | - set(CMAKE_RANLIB "gcc-ranlib") |
985 | | - else() |
986 | | - message(FATAL_ERROR "Your C compiler ${CMAKE_C_COMPILER_ID} does not support the LTO building.") |
987 | | - endif() |
988 | | - if(LIBICAL_CXX_BINDINGS AND CMAKE_CXX_COMPILER_IS_GCC) |
989 | | - include(CheckCXXCompilerFlag) |
990 | | - libical_add_cxxflag(-flto LTO) |
991 | | - if(CXX_SUPPORTS_LTO) |
992 | | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlto-type-mismatch -fuse-linker-plugin") |
993 | | - else() |
994 | | - message(FATAL_ERROR "Your C++ compiler ${CMAKE_CXX_COMPILER_ID} does not support LTO building.") |
995 | | - endif() |
996 | | - endif() |
997 | | - else() |
998 | | - message(FATAL_ERROR "Build link-time optimization using a non-GCC compiler is currently not supported.") |
999 | | - endif() |
| 988 | +libical_deprecated_option( |
| 989 | + ENABLE_LTO_BUILD |
| 990 | + CMAKE_INTERPROCEDURAL_OPTIMIZATION |
| 991 | + "Build a link-time optimized version." |
| 992 | + False |
| 993 | +) |
| 994 | +if(CMAKE_INTERPROCEDURAL_OPTIMIZATION) |
| 995 | + include(CheckIPOSupported) |
| 996 | + # A fatal error is issued if IPO not supported by the compiler |
| 997 | + check_ipo_supported() |
1000 | 998 | endif() |
1001 | 999 |
|
1002 | 1000 | libical_option(LIBICAL_BUILD_TESTING "Build tests." False) |
|
0 commit comments