include my libssh2 and mbedtls as submodules and cmake it up

This commit is contained in:
cy384 2024-10-26 17:29:11 -04:00
parent 3839c5118e
commit b273826487
4 changed files with 27 additions and 7 deletions

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "opentransport-libssh2"]
path = opentransport-libssh2
url = git@github.com:cy384/opentransport-libssh2.git
[submodule "opentransport-mbedtls"]
path = opentransport-mbedtls
url = git@github.com:cy384/opentransport-mbedtls.git

View File

@ -8,15 +8,27 @@ cmake_minimum_required(VERSION 3.9)
project(ssheven) project(ssheven)
add_application(ssheven CREATOR "SSH7" ssheven.c ssheven-console.c ssheven.r ssheven-net.c ssheven-debug.c) add_application(ssheven CREATOR "SSH7" ssheven.c ssheven-console.c ssheven.r ssheven-net.c ssheven-debug.c)
# set up and build mbedtls
set(ENABLE_PROGRAMS OFF CACHE BOOL "disable mbedtls programs" FORCE)
set(UNSAFE_BUILD ON CACHE BOOL "ignore mac os jank fro mbedtls" FORCE)
set(ENABLE_TESTING OFF CACHE BOOL "disable mbedtls tests" FORCE)
add_subdirectory(opentransport-mbedtls)
# set up and build libssh2
set(CRYPTO_BACKEND mbedTLS)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "disable libssh2 shared libs" FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "disable libssh2 examples" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "disable libssh2 tests" FORCE)
add_subdirectory(opentransport-libssh2)
IF(CMAKE_SYSTEM_NAME MATCHES Retro68) IF(CMAKE_SYSTEM_NAME MATCHES Retro68)
# for 68k # for 68k
set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=68020 -O3 -Wall -Wextra -Wno-unused-parameter") set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=68020 -O3 -Wall -Wextra -Wno-unused-parameter")
set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-segments -Wl,${CMAKE_CURRENT_SOURCE_DIR}/ssheven.segmap") set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-segments -Wl,${CMAKE_CURRENT_SOURCE_DIR}/ssheven.segmap")
target_link_libraries(ssheven ssh2 mbedtls mbedx509 mbedcrypto OpenTransportApp OpenTransport OpenTptInet vterm retrocrt) target_link_libraries(ssheven libssh2 mbedtls mbedx509 mbedcrypto OpenTransportApp OpenTransport OpenTptInet vterm retrocrt)
ELSE() ELSE()
# for PPC # for PPC
set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=601 -O3 -Wall -Wextra -Wno-unused-parameter") set_target_properties(ssheven PROPERTIES COMPILE_FLAGS "-ffunction-sections -mcpu=601 -O3 -Wall -Wextra -Wno-unused-parameter")
set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections") set_target_properties(ssheven PROPERTIES LINK_FLAGS "-Wl,-gc-sections")
target_link_libraries(ssheven ThreadsLib ssh2 mbedtls mbedx509 mbedcrypto OpenTransportAppPPC OpenTransportLib OpenTptInternetLib vterm retrocrt) target_link_libraries(ssheven ThreadsLib ssh2 mbedtls mbedx509 mbedcrypto OpenTransportAppPPC OpenTransportLib OpenTptInternetLib vterm retrocrt)
ENDIF() ENDIF()

1
opentransport-libssh2 Submodule

@ -0,0 +1 @@
Subproject commit 2b176f21910bd7f82d7ca3a6ceb4cfb0bd4cbaf4

1
opentransport-mbedtls Submodule

@ -0,0 +1 @@
Subproject commit 01162ec6e5853cb9a94374ab2139023b74d65c9d