# One-shot tool for step 1 (unpacking). Upstream pspdecrypt is GPL-3.0, so it is
# fetched at configure time and only built into this standalone executable,
# never linked into the port.
include(FetchContent)
FetchContent_Declare(pspdecrypt
    GIT_REPOSITORY https://github.com/John-K/pspdecrypt.git
    GIT_TAG c156627db7634d395c380c0a9589130f603307fc
)
FetchContent_MakeAvailable(pspdecrypt)

file(GLOB LIBKIRK_SRCS ${pspdecrypt_SOURCE_DIR}/libkirk/*.c)
add_executable(prxdecrypt main.cpp ${pspdecrypt_SOURCE_DIR}/PrxDecrypter.cpp ${LIBKIRK_SRCS})
target_include_directories(prxdecrypt PRIVATE ${pspdecrypt_SOURCE_DIR})
if(MSVC)
    target_compile_definitions(prxdecrypt PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
