Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
fetch_dep sqlite3 "${platform}" "${arch}" SQLITE3_GITHUB_TOKEN SQLITE3_RELEASE_TAG SQLITE3_GITHUB_REPO
fetch_dep mbedtls "${platform}" "${arch}" MBEDTLS_GITHUB_TOKEN MBEDTLS_RELEASE_TAG MBEDTLS_GITHUB_REPO
fetch_dep axtls "${platform}" "${arch}" AXTLS_GITHUB_TOKEN AXTLS_RELEASE_TAG AXTLS_GITHUB_REPO
fetch_dep qrcodegen "${platform}" "${arch}" QRCODEGEN_GITHUB_TOKEN QRCODEGEN_RELEASE_TAG QRCODEGEN_GITHUB_REPO
fetch_dep skia "${platform}" "${arch}" SKIA_GITHUB_TOKEN SKIA_RELEASE_TAG SKIA_GITHUB_REPO --install-dev
done

Expand Down Expand Up @@ -777,7 +778,9 @@ jobs:
run: |
cmake ../ \
-GXcode \
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64
ruby -pi -e "gsub(\"config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'\", \"config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'arm64'\")" Podfile
pod install
/usr/libexec/PlistBuddy -c "Add :DisableBuildSystemDeprecationDiagnostic bool" TotalCross.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings || true
Expand Down
77 changes: 66 additions & 11 deletions TotalCrossVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,41 @@ if (NOT DEFINED AXTLS_AUTO_FETCH)
set(AXTLS_AUTO_FETCH ON)
endif()

if (NOT DEFINED QRCODE_AUTO_FETCH)
set(QRCODE_AUTO_FETCH ON)
endif()

if (NOT DEFINED QRCODEGEN_AUTO_FETCH)
set(QRCODEGEN_AUTO_FETCH ON)
endif()

if(TCVM_SHARED)
add_library(tcvm SHARED)
else()
add_library(tcvm STATIC)
endif()

# qrcodegen is the default backend and is mandatory for _MSC_VER.
set(TC_QRCODE_MSVC_COMPATIBLE OFF)
set(TC_QRCODE_USE_QRCODEGEN_DEFAULT ON)
if(MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
set(TC_QRCODE_MSVC_COMPATIBLE ON)
endif()

option(TC_QRCODE_USE_QRCODEGEN
"Use qrcodegen instead of qrcode to generate QR codes"
${TC_QRCODE_USE_QRCODEGEN_DEFAULT})

if(TC_QRCODE_MSVC_COMPATIBLE AND NOT TC_QRCODE_USE_QRCODEGEN)
message(FATAL_ERROR "TC_QRCODE_USE_QRCODEGEN must be ON when compiling with _MSC_VER")
endif()

if(TC_QRCODE_USE_QRCODEGEN)
target_compile_definitions(tcvm PRIVATE TC_QRCODE_USE_QRCODEGEN=1)
else()
target_compile_definitions(tcvm PRIVATE TC_QRCODE_USE_QRCODEGEN=0)
endif()

# Force using madler zlib on wince instead of zlib-ng, which isn't supported
if(NOT DEFINED USE_MADLER_ZLIB)
if(TARGET_WINCE)
Expand Down Expand Up @@ -128,6 +157,8 @@ if(NOT EXISTS "${TCVM_DEPOT_TOOLS_DIR}/deps.yml")
endif()

set(CMAKE_MODULE_PATH
"${TCVM_DEPOT_TOOLS_DIR}/qrcode/cmake"
"${TCVM_DEPOT_TOOLS_DIR}/qrcodegen/cmake"
"${TCVM_DEPOT_TOOLS_DIR}/zlib-ng/cmake"
"${TCVM_DEPOT_TOOLS_DIR}/minizip-ng/cmake"
"${TCVM_DEPOT_TOOLS_DIR}/libpng/cmake"
Expand Down Expand Up @@ -165,6 +196,12 @@ foreach(TCVM_DEP_CACHE_VAR
AXTLS_DIR
AXTLS_INCLUDE_DIR
AXTLS_LIBRARY
QRCODE_DIR
QRCODE_INCLUDE_DIR
QRCODE_LIBRARY
QRCODEGEN_DIR
QRCODEGEN_INCLUDE_DIR
QRCODEGEN_LIBRARY
SKIA_CONFIG_INCLUDE_DIR
SKIA_CORE_INCLUDE_DIR
SKIA_UTILS_INCLUDE_DIR
Expand Down Expand Up @@ -192,6 +229,22 @@ if(AXTLS_AUTO_FETCH)
endif()
find_package(AxTLS REQUIRED)

if(TC_QRCODE_USE_QRCODEGEN)
include("${TCVM_DEPOT_TOOLS_DIR}/qrcodegen/cmake/AutoFetchQRCodeGen.cmake")
if(QRCODEGEN_AUTO_FETCH)
tcvm_auto_fetch_qrcodegen()
endif()
find_package(QRCodeGen REQUIRED)
set(TC_QRCODE_LIBRARY QRCodeGen::QRCodeGen)
else()
include("${TCVM_DEPOT_TOOLS_DIR}/qrcode/cmake/AutoFetchQRCode.cmake")
if(QRCODE_AUTO_FETCH)
tcvm_auto_fetch_qrcode()
endif()
find_package(QRCode REQUIRED)
set(TC_QRCODE_LIBRARY QRCode::QRCode)
endif()

if(TARGET_WINCE)
if(NOT DEFINED MINIZIP_DIR)
message(FATAL_ERROR
Expand Down Expand Up @@ -268,7 +321,7 @@ endif()
add_subdirectory(third_party)

if(CMAKE_GENERATOR STREQUAL Xcode)
target_link_libraries(tcvm PRIVATE zlibstatic png_static JPEG::JPEG SQLite::SQLite3 MINIZIP::MINIZIP AxTLS::AxTLS)
target_link_libraries(tcvm PRIVATE zlibstatic png_static JPEG::JPEG SQLite::SQLite3 MINIZIP::MINIZIP AxTLS::AxTLS ${TC_QRCODE_LIBRARY})
if(NOT TARGET_WINCE)
target_link_libraries(tcvm PRIVATE
MbedTLS::mbedtls
Expand All @@ -278,6 +331,7 @@ if(CMAKE_GENERATOR STREQUAL Xcode)
endif()
else()
target_link_libraries(tcvm zlibstatic)
target_link_libraries(tcvm ${TC_QRCODE_LIBRARY})
target_link_libraries(tcvm MINIZIP::MINIZIP)
target_link_libraries(tcvm AxTLS::AxTLS)
target_link_libraries(tcvm png_static)
Expand Down Expand Up @@ -459,14 +513,12 @@ endif(UNIX AND NOT (DEFINED ANDROID_ABI OR APPLE))
if(MSVC)
set(TC_MSVC_SOURCES
${TC_SRCDIR}/util/winsockLib.c
${TC_SRCDIR}/nm/qrcode/win/qrcodegen.c
)
endif(MSVC)

if(NOT MSVC)
set(TC_NOT_MSVC_SOURCES
${TC_SRCDIR}/nm/lang/posix/cpproc.c
${TC_SRCDIR}/nm/qrcode/qrcode.c
)
endif(NOT MSVC)

Expand Down Expand Up @@ -581,15 +633,13 @@ include_directories(${TC_SRCDIR}/tcvm)
include_directories(${TC_SRCDIR}/util)
include_directories(${TC_SRCDIR}/util/android)

if(MSVC)
include_directories(${TC_SRCDIR}/nm/qrcode/win)
if(TARGET_WINCE)
include_directories(${TC_SRCDIR}/core/wince) # Only include this folder for WinCE!
endif()
else()
include_directories(${TC_SRCDIR}/nm/qrcode)
if(MSVC AND TARGET_WINCE)
include_directories(${TC_SRCDIR}/core/wince) # Only include this folder for WinCE!
endif()

if(NOT MSVC)
include_directories(${TC_SRCDIR}/nm/lang/posix)
endif(MSVC)
endif()

# add_definitions
if(DEFINED ANDROID_ABI)
Expand Down Expand Up @@ -653,6 +703,10 @@ endif()
# XCode Properties
if(CMAKE_GENERATOR STREQUAL Xcode)
# Fold prebuilt native dependencies into libtcvm.a at archive creation time.
get_target_property(TC_QRCODE_LIBRARY_PATH ${TC_QRCODE_LIBRARY} IMPORTED_LOCATION)
if(NOT TC_QRCODE_LIBRARY_PATH)
message(FATAL_ERROR "Unable to resolve the selected QR Code static library")
endif()
set(TCVM_XCODE_ARCHIVE_DEPENDENCIES
"${PNG_LIBRARY}"
"${ZLIB_LIBRARY}"
Expand All @@ -661,6 +715,7 @@ if(CMAKE_GENERATOR STREQUAL Xcode)
"${SQLITE3_LIBRARIES}"
"${MBEDTLS_LIBRARIES}"
"${AXTLS_LIBRARY}"
"${TC_QRCODE_LIBRARY_PATH}"
)
if(TCVM_ENABLE_SKIA)
set(TCVM_XCODE_ARCHIVE_DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/deps/totalcross-depot-tools.ref
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: LGPL-2.1-only

axtls-2.1.5-tc.1
qrcodegen-20250123
Loading
Loading