Update CMake configuration and CI/CD workflows
- Upgraded CMake minimum version requirement to 3.16 and updated project version to 0.3.0. - Introduced new CMake presets for build configurations, including default, debug, and release options. - Added CI/CD workflows for continuous integration and release management, enhancing automated testing and deployment processes. - Integrated Asar assembler support with new wrapper classes and CLI commands for patching ROMs. - Implemented comprehensive tests for Asar integration, ensuring robust functionality and error handling. - Enhanced packaging configuration for cross-platform support, including Windows, macOS, and Linux. - Updated documentation and added test assets for improved clarity and usability.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
# Yet Another Zelda3 Editor
|
||||
# by scawful
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(yaze VERSION 0.2.2
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(yaze VERSION 0.3.0
|
||||
DESCRIPTION "Yet Another Zelda3 Editor"
|
||||
LANGUAGES CXX)
|
||||
configure_file(src/yaze_config.h.in yaze_config.h)
|
||||
LANGUAGES CXX C)
|
||||
|
||||
# Set project metadata
|
||||
set(YAZE_VERSION_MAJOR 0)
|
||||
set(YAZE_VERSION_MINOR 3)
|
||||
set(YAZE_VERSION_PATCH 0)
|
||||
|
||||
configure_file(src/yaze_config.h.in yaze_config.h @ONLY)
|
||||
|
||||
# Build Flags
|
||||
set(YAZE_BUILD_APP ON)
|
||||
@@ -14,31 +20,65 @@ set(YAZE_BUILD_Z3ED ON)
|
||||
set(YAZE_BUILD_TESTS ON)
|
||||
set(YAZE_INSTALL_LIB OFF)
|
||||
|
||||
# ROM Testing Configuration
|
||||
option(YAZE_ENABLE_ROM_TESTS "Enable tests that require ROM files" OFF)
|
||||
set(YAZE_TEST_ROM_PATH "${CMAKE_BINARY_DIR}/bin/zelda3.sfc" CACHE STRING "Path to test ROM file")
|
||||
|
||||
# libpng features in bitmap.cc
|
||||
add_definitions("-DYAZE_LIB_PNG=1")
|
||||
|
||||
# C++ Standard and CMake Specifications
|
||||
# Modern CMake standards
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
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)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
# Output directories
|
||||
include(GNUInstallDirs)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_SHARED_MODULE_PREFIX "")
|
||||
|
||||
if (UNIX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dlinux -Dstricmp=strcasecmp")
|
||||
# Platform detection
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(YAZE_PLATFORM_MACOS ON)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(YAZE_PLATFORM_LINUX ON)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(YAZE_PLATFORM_WINDOWS ON)
|
||||
endif()
|
||||
|
||||
if (MACOS)
|
||||
set(CMAKE_INSTALL_PREFIX /usr/local)
|
||||
# Create a common interface target for shared settings
|
||||
add_library(yaze_common INTERFACE)
|
||||
target_compile_features(yaze_common INTERFACE cxx_std_23)
|
||||
|
||||
# Platform-specific configurations
|
||||
if(YAZE_PLATFORM_LINUX)
|
||||
target_compile_definitions(yaze_common INTERFACE linux stricmp=strcasecmp)
|
||||
elseif(YAZE_PLATFORM_MACOS)
|
||||
set(CMAKE_INSTALL_PREFIX /usr/local)
|
||||
target_compile_definitions(yaze_common INTERFACE MACOS)
|
||||
elseif(YAZE_PLATFORM_WINDOWS)
|
||||
include(cmake/vcpkg.cmake)
|
||||
target_compile_definitions(yaze_common INTERFACE WINDOWS)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
include(cmake/vcpkg.cmake)
|
||||
# Compiler-specific settings
|
||||
if(MSVC)
|
||||
target_compile_options(yaze_common INTERFACE /W4 /permissive-)
|
||||
target_compile_definitions(yaze_common INTERFACE
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS
|
||||
strncasecmp=_strnicmp
|
||||
strcasecmp=_stricmp
|
||||
)
|
||||
else()
|
||||
target_compile_options(yaze_common INTERFACE -Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# Abseil Standard Specifications
|
||||
@@ -62,3 +102,6 @@ include(cmake/gtest.cmake)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
# Packaging configuration
|
||||
include(cmake/packaging.cmake)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user