@@ -161,6 +161,8 @@ option(VIX_ENABLE_SANITIZERS "Enable ASan+UBSan (GCC/Clang only)"
161161option (VIX_BUILD_EXAMPLES "Build umbrella examples in ./examples" ON )
162162option (VIX_BUILD_TESTS "Build Vix SDK package and domain tests" OFF )
163163option (VIX_BUILD_NETWORK "Build the Network domain when its provider is available" ON )
164+ option (VIX_BUILD_TLS_I0B_TESTS "Build the private Linux TLS-I0-B feasibility tests" OFF )
165+ option (VIX_BUILD_TLS_EXPERIMENTAL "Build the uninstalled experimental TLS Domain" OFF )
164166
165167function (vix_apply_canonical_warnings target )
166168 if (NOT VIX_ENABLE_WARNINGS OR NOT TARGET "${target} " )
@@ -183,7 +185,7 @@ endfunction()
183185function (vix_apply_canonical_warnings_recursively directory )
184186 get_property (_vix_targets DIRECTORY "${directory} " PROPERTY BUILDSYSTEM_TARGETS)
185187 foreach (_vix_target IN LISTS _vix_targets)
186- if (_vix_target MATCHES "^vix_(standard|files|process|network|concurrency)(_|$)" )
188+ if (_vix_target MATCHES "^vix_(standard|files|process|network|concurrency|tls_i0b|tls_experimental )(_|$)" )
187189 vix_apply_canonical_warnings ("${_vix_target} " )
188190 endif ()
189191 endforeach ()
@@ -221,6 +223,38 @@ else()
221223 set (VIX_HAS_NETWORK FALSE )
222224endif ()
223225
226+ # TLS is explicitly experimental and is never installed/exported. Its current
227+ # lease and runtime qualification is Linux-only; ordinary Vix configurations
228+ # do not discover or link OpenSSL.
229+ if (VIX_BUILD_TLS_EXPERIMENTAL OR VIX_BUILD_TLS_I0B_TESTS)
230+ if (NOT VIX_HAS_NETWORK OR NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" )
231+ message (FATAL_ERROR "Experimental TLS currently requires the Linux Network provider." )
232+ endif ()
233+ find_package (OpenSSL 3 REQUIRED COMPONENTS SSL Crypto )
234+ add_library (vix_tls_experimental STATIC
235+ domains/tls/src/OpenSslDriver.cpp
236+ domains/tls/src/PrivateChannel.cpp
237+ domains/tls/src/TlsConfig.cpp
238+ domains/tls/src/TlsChannel.cpp )
239+ add_library (vix::tls_experimental ALIAS vix_tls_experimental )
240+ target_compile_features (vix_tls_experimental PUBLIC cxx_std_20 )
241+ target_include_directories (vix_tls_experimental
242+ PUBLIC
243+ $<BUILD_INTERFACE :${CMAKE_SOURCE_DIR } /domains /tls /include >
244+ PRIVATE
245+ ${CMAKE_SOURCE_DIR } /domains/tls/src
246+ ${CMAKE_SOURCE_DIR } /domains/network/src )
247+ target_link_libraries (vix_tls_experimental
248+ PUBLIC vix::network vix::standard
249+ PRIVATE OpenSSL::SSL OpenSSL::Crypto )
250+ if (VIX_BUILD_TLS_I0B_TESTS)
251+ if (NOT VIX_BUILD_TESTS)
252+ message (FATAL_ERROR "VIX_BUILD_TLS_I0B_TESTS requires VIX_BUILD_TESTS." )
253+ endif ()
254+ add_subdirectory (domains/tls/tests tls_i0b_tests )
255+ endif ()
256+ endif ()
257+
224258# Apply diagnostics only to the canonical Vix domain targets and their owned
225259# tests. Third-party targets and exported consumer usage requirements are not
226260# affected.
0 commit comments