2020-11-21 23:25:44 -06:00
|
|
|
cmake_minimum_required(VERSION 3.19)
|
|
|
|
set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2022-03-24 20:47:47 -05:00
|
|
|
if(BUILDCORE_TARGET STREQUAL "gba")
|
2022-07-10 01:38:40 -05:00
|
|
|
project(nostalgia ASM CXX)
|
2022-03-24 20:47:47 -05:00
|
|
|
elseif(APPLE)
|
2022-07-10 01:38:40 -05:00
|
|
|
project(nostalgia C CXX OBJC OBJCXX)
|
2022-03-12 02:36:32 -06:00
|
|
|
else()
|
2022-07-10 01:38:40 -05:00
|
|
|
project(nostalgia C CXX)
|
2022-03-12 02:36:32 -06:00
|
|
|
endif()
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2022-03-13 03:09:16 -05:00
|
|
|
include(deps/buildcore/base.cmake)
|
|
|
|
|
2021-03-02 21:02:16 -06:00
|
|
|
set(OX_ENABLE_TRACEHOOK OFF CACHE BOOL "Generate OxTraceHook shared library for uprobes")
|
|
|
|
|
|
|
|
if(BUILDCORE_TARGET STREQUAL "gba")
|
2021-04-03 02:40:57 -05:00
|
|
|
include(deps/gbabuildcore/base.cmake)
|
2021-03-02 21:02:16 -06:00
|
|
|
else()
|
2019-12-06 01:11:30 -06:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
2018-03-13 20:21:18 -05:00
|
|
|
|
2023-07-01 16:04:24 -05:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2023-12-16 20:08:26 -06:00
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_MACOSX_RPATH OFF)
|
|
|
|
else()
|
|
|
|
if(UNIX)
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
endif()
|
|
|
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
|
|
|
endif()
|
|
|
|
|
2020-05-29 19:36:00 -05:00
|
|
|
add_subdirectory(deps/ox)
|
2021-05-16 13:04:32 -05:00
|
|
|
include_directories(
|
2022-05-25 21:23:24 -05:00
|
|
|
deps/ox/src
|
2021-05-16 13:04:32 -05:00
|
|
|
)
|
2023-06-18 23:02:03 -05:00
|
|
|
add_subdirectory(deps/teagba)
|
2020-05-29 19:36:00 -05:00
|
|
|
|
2023-06-18 23:02:03 -05:00
|
|
|
if(NOT BUILDCORE_TARGET STREQUAL "gba")
|
2022-03-12 02:36:32 -06:00
|
|
|
include_directories(
|
|
|
|
SYSTEM
|
|
|
|
deps/glfw/include
|
|
|
|
deps/imgui
|
|
|
|
deps/imgui/backends
|
2022-05-25 21:23:24 -05:00
|
|
|
deps/nfde/src/include
|
2023-08-08 23:58:08 -05:00
|
|
|
/usr/local/include
|
2022-03-12 02:36:32 -06:00
|
|
|
)
|
2022-07-09 20:20:37 -05:00
|
|
|
add_subdirectory(deps/glad)
|
2023-12-01 22:59:53 -06:00
|
|
|
set(GLFW_BUILD_EXAMPLES OFF)
|
|
|
|
set(GLFW_BUILD_TESTS OFF)
|
|
|
|
set(GLFW_BUILD_DOCS OFF)
|
2022-03-11 22:16:59 -06:00
|
|
|
add_subdirectory(deps/glfw)
|
2023-12-11 22:54:55 -06:00
|
|
|
add_subdirectory(deps/glutils)
|
2021-05-16 13:04:32 -05:00
|
|
|
add_subdirectory(deps/imgui)
|
2022-05-25 21:23:24 -05:00
|
|
|
add_subdirectory(deps/lodepng)
|
|
|
|
add_subdirectory(deps/nfde)
|
2019-11-03 23:23:43 -06:00
|
|
|
endif()
|
|
|
|
|
2016-03-26 15:49:05 -05:00
|
|
|
add_subdirectory(src)
|