if(NOT WIN32)   # Linux (Steam Deck): the same headers on POSIX, see updater/posix/
add_library(uc_update_core STATIC release.cpp sha256.cpp posix/files_posix.cpp posix/package_posix.cpp posix/transaction_posix.cpp transaction_faults.cpp)
target_include_directories(uc_update_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/posix)
target_link_libraries(uc_update_core PUBLIC nlohmann_json::nlohmann_json uc_miniz)
add_library(uc_update_download STATIC download_common.cpp posix/download_curl.cpp)   # libcurl: the Deck has libcurl.so.4
# The sysroot holds copies, not symlinks: libcurl.so is the GnuTLS flavour (libcurl-gnutls.so.4), but the Deck ships libcurl.so.4 (OpenSSL), so link that file by name.
find_library(UC_CURL NAMES libcurl.so.4 curl REQUIRED)
target_link_libraries(uc_update_download PUBLIC uc_update_core ${UC_CURL})
return()
endif()
add_library(uc_update_core STATIC release.cpp sha256.cpp files.cpp package.cpp transaction.cpp transaction_faults.cpp)
target_include_directories(uc_update_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(uc_update_core PUBLIC nlohmann_json::nlohmann_json uc_miniz bcrypt ntdll uc_windows_path)
target_compile_definitions(uc_update_core PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
add_library(uc_update_download STATIC download.cpp download_common.cpp)
target_link_libraries(uc_update_download PUBLIC uc_update_core PRIVATE winhttp)
target_compile_definitions(uc_update_download PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
add_library(uc_update_process STATIC process.cpp)
target_link_libraries(uc_update_process PUBLIC uc_update_core uc_client_update_lock uc_windows_args)
target_compile_definitions(uc_update_process PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
add_executable(uc_updater WIN32 main.cpp app.manifest ${CMAKE_SOURCE_DIR}/assets/app.rc)
target_link_libraries(uc_updater PRIVATE uc_update_process uc_launcher_locale shell32 user32 gdi32 dwmapi)   # uc_launcher_locale: the window's texts in the launcher's language
target_compile_definitions(uc_updater PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)
target_link_options(uc_updater PRIVATE /DEPENDENTLOADFLAG:0xA00)
install(PROGRAMS ${UC_COMPAT_DIR}/updater/uc_updater.exe DESTINATION .)   # the x86-64-v2 build: the updater starts on every CPU (UC_ARCH in the root CMakeLists.txt)
