if(USE_SYSTEM_WOLFSSL)
	message(STATUS "RPCS3: using shared wolfssl")
	pkg_check_modules(WolfSSL REQUIRED IMPORTED_TARGET wolfssl>=4.7.0)
	add_library(wolfssl INTERFACE)
	target_link_libraries(wolfssl INTERFACE PkgConfig::WolfSSL)
else()
	set(WOLFSSL_TLS13 OFF CACHE INTERNAL "")
	set(WOLFSSL_SHA3 ON CACHE INTERNAL "")
	set(WOLFSSL_SHAKE256 ON CACHE INTERNAL "")
	set(WOLFSSL_BASE64_ENCODE OFF CACHE INTERNAL "")
	set(WOLFSSL_DES3 ON CACHE INTERNAL "")
	set(WOLFSSL_PWDBASED ON CACHE INTERNAL "")
	set(WOLFSSL_FAST_MATH ON CACHE INTERNAL "")
	set(WOLFSSL_EXAMPLES OFF CACHE INTERNAL "")
	set(WOLFSSL_CRYPT_TESTS OFF CACHE INTERNAL "")
	set(WOLFSSL_ASYNC_THREADS OFF CACHE INTERNAL "")
	set(WOLFSSL_BUILD_OUT_OF_TREE ON CACHE INTERNAL "")
	set(WOLFSSL_SNI ON CACHE INTERNAL "")
	set(WOLFSSL_OPENSSLEXTRA ON CACHE INTERNAL "")
	set(WOLFSSL_ALT_CERT_CHAINS ON CACHE INTERNAL "")

	add_subdirectory(wolfssl EXCLUDE_FROM_ALL)

	target_compile_definitions(wolfssl PUBLIC WOLFSSL_DES_ECB HAVE_WRITE_DUP FP_MAX_BITS=8192 WOLFSSL_USE_OPTIONS_H)
endif()
