backend-infra-engineer: Pre-0.2.2 2024 Q4 snapshot
This commit is contained in:
@@ -1,32 +1,3 @@
|
||||
set(
|
||||
YAZE_APP_CORE_SRC
|
||||
app/core/common.cc
|
||||
app/core/controller.cc
|
||||
app/core/labeling.cc
|
||||
app/emu/emulator.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_APP_GFX_SRC
|
||||
app/gfx/bitmap.cc
|
||||
app/gfx/compression.cc
|
||||
app/gfx/scad_format.cc
|
||||
app/gfx/snes_palette.cc
|
||||
app/gfx/snes_tile.cc
|
||||
app/gfx/snes_color.cc
|
||||
app/gfx/tilesheet.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_GUI_SRC
|
||||
app/gui/asset_browser.cc
|
||||
app/gui/canvas.cc
|
||||
app/gui/input.cc
|
||||
app/gui/style.cc
|
||||
app/gui/color.cc
|
||||
app/gui/zeml.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_APP_EMU_SRC
|
||||
app/emu/audio/apu.cc
|
||||
@@ -43,70 +14,125 @@ set(
|
||||
app/emu/snes.cc
|
||||
)
|
||||
|
||||
set(SDL_TARGETS SDL2::SDL2)
|
||||
set(YAZE_RESOURCE_FILES
|
||||
${CMAKE_SOURCE_DIR}/assets/layouts/overworld.zeml
|
||||
${CMAKE_SOURCE_DIR}/assets/font/Karla-Regular.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/Roboto-Medium.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/Cousine-Regular.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/DroidSans.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/NotoSansJP.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/IBMPlexSansJP-Bold.ttf
|
||||
${CMAKE_SOURCE_DIR}/assets/font/MaterialIcons-Regular.ttf
|
||||
)
|
||||
|
||||
if(WIN32 OR MINGW)
|
||||
list(PREPEND SDL_TARGETS SDL2::SDL2main ws2_32)
|
||||
add_definitions(-DSDL_MAIN_HANDLED)
|
||||
endif()
|
||||
|
||||
if (WIN32 OR MINGW OR UNIX AND NOT APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/font_loader.cc
|
||||
app/core/platform/clipboard.cc
|
||||
foreach (FILE ${YAZE_RESOURCE_FILES})
|
||||
file(RELATIVE_PATH NEW_FILE "${CMAKE_SOURCE_DIR}/assets" ${FILE})
|
||||
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
|
||||
set_source_files_properties(${FILE}
|
||||
PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
if (YAZE_BUILD_APP)
|
||||
include(app/app.cmake)
|
||||
endif()
|
||||
if (YAZE_BUILD_EMU)
|
||||
include(app/emu/emu.cmake)
|
||||
endif()
|
||||
if (YAZE_BUILD_Z3ED)
|
||||
include(cli/z3ed.cmake)
|
||||
endif()
|
||||
if (YAZE_BUILD_PYTHON)
|
||||
include(cli/python/yaze_py.cmake)
|
||||
endif()
|
||||
if (YAZE_BUILD_TESTS)
|
||||
include(test/CMakeLists.txt)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/file_dialog.mm
|
||||
app/core/platform/app_delegate.mm
|
||||
app/core/platform/font_loader.mm
|
||||
app/core/platform/clipboard.mm
|
||||
app/core/platform/file_path.mm
|
||||
)
|
||||
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Cocoa not found")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework ServiceManagement -framework Foundation -framework Cocoa")
|
||||
endif()
|
||||
|
||||
include(app/CMakeLists.txt)
|
||||
# include(cli/CMakeLists.txt) Excluded for now, macOS include breaks action build
|
||||
|
||||
if (UNIX)
|
||||
target_compile_definitions(yaze PRIVATE "linux")
|
||||
target_compile_definitions(yaze PRIVATE "stricmp=strcasecmp")
|
||||
endif()
|
||||
|
||||
if(MACOS)
|
||||
set(MACOSX_BUNDLE_ICON_FILE ${CMAKE_SOURCE_DIR}/yaze.ico)
|
||||
set_target_properties(yaze
|
||||
PROPERTIES
|
||||
BUNDLE True
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/yaze.plist.in
|
||||
if(MACOS)
|
||||
set(MACOSX_BUNDLE_ICON_FILE ${CMAKE_SOURCE_DIR}/win32/yaze.ico)
|
||||
set_target_properties(yaze
|
||||
PROPERTIES
|
||||
BUNDLE True
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/yaze.plist.in
|
||||
RESOURCE ${YAZE_RESOURCE_FILES}
|
||||
)
|
||||
elseif(UNIX)
|
||||
set_target_properties(yaze
|
||||
set_target_properties(yaze
|
||||
PROPERTIES
|
||||
BUNDLE True
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
target_compile_definitions(yaze PRIVATE "linux")
|
||||
target_compile_definitions(yaze PRIVATE "stricmp=strcasecmp")
|
||||
else()
|
||||
set_target_properties(yaze
|
||||
set_target_properties(yaze
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
LINK_FLAGS "${CMAKE_CURRENT_SOURCE_DIR}/yaze.res"
|
||||
)
|
||||
LINK_FLAGS "${CMAKE_CURRENT_SOURCE_DIR}/win32/yaze.res"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(test)
|
||||
# Yaze C API
|
||||
if (YAZE_BUILD_LIB)
|
||||
add_library(
|
||||
yaze_c SHARED
|
||||
./yaze.cc
|
||||
app/rom.cc
|
||||
${YAZE_APP_EMU_SRC}
|
||||
${YAZE_APP_CORE_SRC}
|
||||
${YAZE_APP_EDITOR_SRC}
|
||||
${YAZE_APP_GFX_SRC}
|
||||
${YAZE_APP_ZELDA3_SRC}
|
||||
${YAZE_GUI_SRC}
|
||||
${IMGUI_SRC}
|
||||
${IMGUI_TEST_ENGINE_SOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
yaze_c PUBLIC
|
||||
lib/
|
||||
app/
|
||||
${CMAKE_SOURCE_DIR}/incl/
|
||||
${CMAKE_SOURCE_DIR}/src/
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${SDL2_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
yaze_c PRIVATE
|
||||
${ABSL_TARGETS}
|
||||
${SDL_TARGETS}
|
||||
${PNG_LIBRARIES}
|
||||
${CMAKE_DL_LIBS}
|
||||
ImGuiTestEngine
|
||||
ImGui
|
||||
)
|
||||
|
||||
if (YAZE_INSTALL_LIB)
|
||||
install(TARGETS yaze_c
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib/static)
|
||||
|
||||
install(
|
||||
FILES
|
||||
yaze.h
|
||||
incl/sprite.h
|
||||
incl/snes_tile.h
|
||||
incl/snes_color.h
|
||||
incl/overworld.h
|
||||
incl/dungeon.h
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user