diff --git a/.gitmodules b/.gitmodules index 7dc8bb2..0fb33b3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "story-editor/externals/curl"] path = story-editor/externals/curl url = https://github.com/curl/curl +[submodule "story-editor/externals/mbedtls"] + path = story-editor/externals/mbedtls + url = https://github.com/Mbed-TLS/mbedtls/ diff --git a/story-editor/CMakeLists.txt b/story-editor/CMakeLists.txt index 4821aa7..e2893d6 100644 --- a/story-editor/CMakeLists.txt +++ b/story-editor/CMakeLists.txt @@ -58,19 +58,37 @@ add_subdirectory(externals/civetweb EXCLUDE_FROM_ALL) include_directories(externals/civetweb/include) -# set(CURL_USE_OPENSSL OFF CACHE BOOL "Disable OpenSSL." FORCE) -# set(CURL_USE_MBEDTLS ON CACHE BOOL "Use MBED TLS." FORCE) -# set(MBEDTLS_INCLUDE_DIRS ${mbedtls_SOURCE_DIR}/include) -# set(MBEDTLS_LIBRARY ${mbedtls_BINARY_DIR}/libmbedtls.a) -# set(MBEDX509_LIBRARY ${mbedtls_BINARY_DIR}/libmbedx509.a) -# set(MBEDCRYPTO_LIBRARY ${mbedtls_BINARY_DIR}/libmbedcrypto.a) +# ========================================================================================================================= +# MBEDTLS +# ========================================================================================================================= +set(USE_STATIC_MBEDTLS_LIBRARY ON) +set(ENABLE_PROGRAMS OFF) +set(ENABLE_TESTING OFF) +add_subdirectory(externals/mbedtls EXCLUDE_FROM_ALL) + +# ========================================================================================================================= +# CURL +# ========================================================================================================================= +set(CURL_USE_OPENSSL OFF CACHE BOOL "Disable OpenSSL." FORCE) +set(CURL_USE_MBEDTLS ON CACHE BOOL "Use MBED TLS." FORCE) +set(MBEDTLS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/externals/mbedtls/include) +set(MBEDTLS_LIBRARY ${CMAKE_BINARY_DIR}/externals/mbedtls/library/libmbedtls.a) +set(MBEDX509_LIBRARY ${CMAKE_BINARY_DIR}/externals/mbedtls/library/libmbedx509.a) +set(MBEDCRYPTO_LIBRARY ${CMAKE_BINARY_DIR}/externals/mbedtls/library/libmbedcrypto.a) + + set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Disable SSH." FORCE) set(CURL_USE_LIBPSL OFF CACHE BOOL "Disable PSL" FORCE) # PSL not working for cross builds (ie, mingw32), or needs to cross-build one set(BUILD_CURL_EXE FALSE) set(BUILD_STATIC_LIBS TRUE) add_subdirectory(externals/curl EXCLUDE_FROM_ALL) + +# ========================================================================================================================= +# SDL +# ========================================================================================================================= + # Configure SDL by calling its CMake file. # we use EXCLUDE_FROM_ALL so that its install targets and configs don't # pollute upwards into our configuration. @@ -249,12 +267,17 @@ set(SDL_MIXER_BIN_DIR ${CMAKE_BINARY_DIR}/externals/SDL_mixer) if(UNIX) target_link_libraries(${STORY_EDITOR_PROJECT} + + PUBLIC SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer SDL3::SDL3 CURL::libcurl civetweb-cpp + MbedTLS::mbedtls + MbedTLS::mbedcrypto + MbedTLS::mbedx509 pthread OpenGL::GL dl @@ -268,6 +291,9 @@ elseif(WIN32) civetweb-cpp SDL3::SDL3 libcurl_static + MbedTLS::mbedtls + MbedTLS::tfpsacrypto + MbedTLS::mbedx509 ws2_32.lib psapi.lib setupapi.lib cfgmgr32.lib advapi32.lib ) endif()