2025-04-24 16:39:24 +02:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
|
|
|
|
|
|
|
|
|
project(test)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED true)
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
2025-06-22 21:05:09 +02:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
2025-04-24 16:39:24 +02:00
|
|
|
|
2025-06-22 21:05:09 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
|
|
|
|
if(${PD_BUILD_SHARED})
|
|
|
|
|
message(ERROR "3DS Only supports Static libraries")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_subdirectory(../ palladium)
|
2026-01-28 07:40:34 +01:00
|
|
|
|
2025-06-22 21:05:09 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
|
|
|
|
add_subdirectory(../backends/3ds pd-3ds)
|
2025-04-24 16:39:24 +02:00
|
|
|
else()
|
2025-06-22 21:05:09 +02:00
|
|
|
add_subdirectory(../backends/desktop pd-desktop)
|
2025-04-24 16:39:24 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_executable(test source/main.cpp
|
2025-06-22 21:05:09 +02:00
|
|
|
${BKND_SRC})
|
2026-01-28 07:40:34 +01:00
|
|
|
|
2025-06-22 21:05:09 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
|
|
|
|
target_link_libraries(test PUBLIC pd-3ds palladium)
|
2025-04-24 16:39:24 +02:00
|
|
|
else()
|
2025-06-22 21:05:09 +02:00
|
|
|
target_link_libraries(test PUBLIC pd-desktop palladium)
|
|
|
|
|
endif()
|
|
|
|
|
|
2026-01-28 07:40:34 +01:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
|
|
|
|
|
target_compile_options(palladium PRIVATE
|
|
|
|
|
$<$<COMPILE_LANGUAGE:C>:-Wall>
|
|
|
|
|
$<$<COMPILE_LANGUAGE:C>:-Wno-psabi>
|
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2026-03-14 21:15:40 +01:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
2026-01-28 07:40:34 +01:00
|
|
|
target_compile_options(palladium PRIVATE
|
|
|
|
|
$<$<CONFIG:Debug>:-O0 -g>
|
|
|
|
|
$<$<CONFIG:Release>:-O3>
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# set(RC_FILES
|
|
|
|
|
# testassets/ComicNeue.ttf
|
|
|
|
|
# testassets/logo.png
|
|
|
|
|
# testassets/test.png)
|
|
|
|
|
# install(FILES ${RC_FILES} DESTINATION ".")
|
|
|
|
|
# else()
|
|
|
|
|
# target_link_libraries(test PUBLIC pd-backend-3ds ctru citro3d)
|
|
|
|
|
# endif()
|