chore: enhance clangd and CI configurations for improved development experience
- Updated `.clangd` configuration to include additional include paths and feature flags tailored for ROM hacking workflows, optimizing IntelliSense support. - Introduced `.pre-commit-config.yaml` for managing code quality checks and formatting, ensuring consistent code style across the project. - Added `cmake-format.yaml` for CMake formatting configuration, promoting adherence to style guidelines. - Enhanced CI workflows to include new actions for testing and building, improving overall reliability and efficiency in the development process. Benefits: - Streamlines development setup and improves code quality through automated checks. - Facilitates better collaboration by ensuring consistent coding standards and configurations.
This commit is contained in:
48
cmake/CPM.cmake
Normal file
48
cmake/CPM.cmake
Normal file
@@ -0,0 +1,48 @@
|
||||
# CPM.cmake - C++ Package Manager
|
||||
# https://github.com/cpm-cmake/CPM.cmake
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.38.7)
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
function(download_cpm)
|
||||
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
|
||||
download_cpm()
|
||||
else()
|
||||
# resume download if it previously failed
|
||||
file(READ ${CPM_DOWNLOAD_LOCATION} check)
|
||||
if("${check}" STREQUAL "")
|
||||
download_cpm()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
|
||||
# Set CPM options for better caching and performance
|
||||
set(CPM_USE_LOCAL_PACKAGES ON)
|
||||
set(CPM_LOCAL_PACKAGES_ONLY OFF)
|
||||
set(CPM_DONT_CREATE_PACKAGE_LOCK ON)
|
||||
set(CPM_DONT_UPDATE_MODULE_PATH ON)
|
||||
set(CPM_DONT_PREPEND_TO_MODULE_PATH ON)
|
||||
|
||||
# Set cache directory for CI builds
|
||||
if(DEFINED ENV{GITHUB_ACTIONS})
|
||||
set(CPM_SOURCE_CACHE "$ENV{HOME}/.cpm-cache")
|
||||
message(STATUS "CPM cache directory: ${CPM_SOURCE_CACHE}")
|
||||
endif()
|
||||
@@ -1,155 +1,68 @@
|
||||
# This file centralizes the management of all third-party dependencies.
|
||||
# It provides functions to find or fetch dependencies and creates alias targets
|
||||
# for consistent usage throughout the project.
|
||||
# YAZE Dependencies Management
|
||||
# Centralized dependency management using CPM.cmake
|
||||
|
||||
include(FetchContent)
|
||||
# Include CPM and options
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/options.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
# ============================================================================
|
||||
# Helper function to add a dependency
|
||||
# ============================================================================
|
||||
function(yaze_add_dependency name)
|
||||
set(options)
|
||||
set(oneValueArgs GIT_REPOSITORY GIT_TAG URL)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(DEP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
message(STATUS "=== Setting up YAZE dependencies with CPM.cmake ===")
|
||||
|
||||
if(TARGET yaze::${name})
|
||||
return()
|
||||
endif()
|
||||
# Clear any previous dependency targets
|
||||
set(YAZE_ALL_DEPENDENCIES "")
|
||||
set(YAZE_SDL2_TARGETS "")
|
||||
set(YAZE_YAML_TARGETS "")
|
||||
set(YAZE_IMGUI_TARGETS "")
|
||||
set(YAZE_GRPC_TARGETS "")
|
||||
set(YAZE_FTXUI_TARGETS "")
|
||||
set(YAZE_TESTING_TARGETS "")
|
||||
|
||||
# Try to find the package via find_package first
|
||||
find_package(${name} QUIET)
|
||||
# Core dependencies (always required)
|
||||
include(cmake/dependencies/sdl2.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_SDL2_TARGETS})
|
||||
|
||||
if(${name}_FOUND)
|
||||
message(STATUS "Found ${name} via find_package")
|
||||
if(TARGET ${name}::${name})
|
||||
add_library(yaze::${name} ALIAS ${name}::${name})
|
||||
else()
|
||||
# Handle cases where find_package doesn't create an imported target
|
||||
# This is a simplified approach; more logic may be needed for specific packages
|
||||
add_library(yaze::${name} INTERFACE IMPORTED)
|
||||
target_include_directories(yaze::${name} INTERFACE ${${name}_INCLUDE_DIRS})
|
||||
target_link_libraries(yaze::${name} INTERFACE ${${name}_LIBRARIES})
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
include(cmake/dependencies/yaml.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_YAML_TARGETS})
|
||||
|
||||
# If not found, use FetchContent
|
||||
message(STATUS "Could not find ${name}, fetching from source.")
|
||||
FetchContent_Declare(
|
||||
${name}
|
||||
GIT_REPOSITORY ${DEP_GIT_REPOSITORY}
|
||||
GIT_TAG ${DEP_GIT_TAG}
|
||||
)
|
||||
include(cmake/dependencies/imgui.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_IMGUI_TARGETS})
|
||||
|
||||
FetchContent_GetProperties(${name})
|
||||
if(NOT ${name}_POPULATED)
|
||||
FetchContent_Populate(${name})
|
||||
add_subdirectory(${${name}_SOURCE_DIR} ${${name}_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
if(TARGET ${name})
|
||||
add_library(yaze::${name} ALIAS ${name})
|
||||
elseif(TARGET ${name}::${name})
|
||||
add_library(yaze::${name} ALIAS ${name}::${name})
|
||||
else()
|
||||
message(FATAL_ERROR "Failed to create target for ${name}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# ============================================================================
|
||||
# Dependency Declarations
|
||||
# ============================================================================
|
||||
|
||||
# gRPC (must come before Abseil - provides its own compatible Abseil)
|
||||
if(YAZE_WITH_GRPC)
|
||||
include(cmake/grpc.cmake)
|
||||
# Verify ABSL_TARGETS was populated by gRPC
|
||||
list(LENGTH ABSL_TARGETS _absl_count)
|
||||
if(_absl_count EQUAL 0)
|
||||
message(FATAL_ERROR "ABSL_TARGETS is empty after including grpc.cmake!")
|
||||
else()
|
||||
message(STATUS "gRPC provides ${_absl_count} Abseil targets for linking")
|
||||
endif()
|
||||
# Optional dependencies based on feature flags
|
||||
if(YAZE_ENABLE_GRPC)
|
||||
include(cmake/dependencies/grpc.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_GRPC_TARGETS})
|
||||
endif()
|
||||
|
||||
# Abseil (only if gRPC didn't provide it)
|
||||
if(NOT YAZE_WITH_GRPC)
|
||||
include(cmake/absl.cmake)
|
||||
# Verify ABSL_TARGETS was populated
|
||||
list(LENGTH ABSL_TARGETS _absl_count)
|
||||
if(_absl_count EQUAL 0)
|
||||
message(FATAL_ERROR "ABSL_TARGETS is empty after including absl.cmake!")
|
||||
else()
|
||||
message(STATUS "Abseil provides ${_absl_count} targets for linking")
|
||||
endif()
|
||||
if(YAZE_BUILD_CLI)
|
||||
include(cmake/dependencies/ftxui.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_FTXUI_TARGETS})
|
||||
endif()
|
||||
|
||||
set(YAZE_PROTOBUF_TARGETS)
|
||||
|
||||
if(TARGET protobuf::libprotobuf)
|
||||
list(APPEND YAZE_PROTOBUF_TARGETS protobuf::libprotobuf)
|
||||
else()
|
||||
if(TARGET libprotobuf)
|
||||
list(APPEND YAZE_PROTOBUF_TARGETS libprotobuf)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# WHOLEARCHIVE logic removed - protobuf linking now handled by yaze_grpc_support library
|
||||
|
||||
if(YAZE_PROTOBUF_TARGETS)
|
||||
list(GET YAZE_PROTOBUF_TARGETS 0 YAZE_PROTOBUF_TARGET)
|
||||
else()
|
||||
set(YAZE_PROTOBUF_TARGET "")
|
||||
endif()
|
||||
|
||||
# SDL2
|
||||
include(cmake/sdl2.cmake)
|
||||
|
||||
# Asar
|
||||
include(cmake/asar.cmake)
|
||||
|
||||
# Google Test
|
||||
if(YAZE_BUILD_TESTS)
|
||||
include(cmake/gtest.cmake)
|
||||
include(cmake/dependencies/testing.cmake)
|
||||
list(APPEND YAZE_ALL_DEPENDENCIES ${YAZE_TESTING_TARGETS})
|
||||
endif()
|
||||
|
||||
# ImGui
|
||||
include(cmake/imgui.cmake)
|
||||
# ASAR dependency (for ROM assembly) - temporarily disabled
|
||||
# TODO: Add CMakeLists.txt to bundled ASAR or find working repository
|
||||
message(STATUS "ASAR dependency temporarily disabled - will be added later")
|
||||
|
||||
# FTXUI (for z3ed)
|
||||
if(YAZE_BUILD_Z3ED)
|
||||
FetchContent_Declare(ftxui
|
||||
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
||||
GIT_TAG v5.0.0
|
||||
)
|
||||
FetchContent_MakeAvailable(ftxui)
|
||||
# Print dependency summary
|
||||
message(STATUS "=== YAZE Dependencies Summary ===")
|
||||
message(STATUS "Total dependencies: ${YAZE_ALL_DEPENDENCIES}")
|
||||
message(STATUS "SDL2: ${YAZE_SDL2_TARGETS}")
|
||||
message(STATUS "YAML: ${YAZE_YAML_TARGETS}")
|
||||
message(STATUS "ImGui: ${YAZE_IMGUI_TARGETS}")
|
||||
if(YAZE_ENABLE_GRPC)
|
||||
message(STATUS "gRPC: ${YAZE_GRPC_TARGETS}")
|
||||
endif()
|
||||
|
||||
# yaml-cpp (always available for configuration files)
|
||||
set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Disable yaml-cpp tests" FORCE)
|
||||
set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Disable yaml-cpp contrib" FORCE)
|
||||
set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Disable yaml-cpp tools" FORCE)
|
||||
set(YAML_CPP_INSTALL OFF CACHE BOOL "Disable yaml-cpp install" FORCE)
|
||||
set(YAML_CPP_FORMAT_SOURCE OFF CACHE BOOL "Disable yaml-cpp format target" FORCE)
|
||||
|
||||
# yaml-cpp (uses CMAKE_POLICY_VERSION_MINIMUM set in root CMakeLists.txt)
|
||||
FetchContent_Declare(yaml-cpp
|
||||
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
|
||||
GIT_TAG 0.8.0
|
||||
)
|
||||
FetchContent_MakeAvailable(yaml-cpp)
|
||||
|
||||
# Fix MSVC exception handling warning for yaml-cpp
|
||||
if(MSVC AND TARGET yaml-cpp)
|
||||
target_compile_options(yaml-cpp PRIVATE /EHsc)
|
||||
if(YAZE_BUILD_CLI)
|
||||
message(STATUS "FTXUI: ${YAZE_FTXUI_TARGETS}")
|
||||
endif()
|
||||
|
||||
# nlohmann_json (header only)
|
||||
if(YAZE_WITH_JSON)
|
||||
set(JSON_BuildTests OFF CACHE INTERNAL "Disable nlohmann_json tests")
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/third_party/json ${CMAKE_BINARY_DIR}/third_party/json EXCLUDE_FROM_ALL)
|
||||
if(YAZE_BUILD_TESTS)
|
||||
message(STATUS "Testing: ${YAZE_TESTING_TARGETS}")
|
||||
endif()
|
||||
message(STATUS "=================================")
|
||||
|
||||
# httplib (header only)
|
||||
# No action needed here as it's included directly.
|
||||
# Export all dependency targets for use in other CMake files
|
||||
set(YAZE_ALL_DEPENDENCIES ${YAZE_ALL_DEPENDENCIES} PARENT_SCOPE)
|
||||
25
cmake/dependencies.lock
Normal file
25
cmake/dependencies.lock
Normal file
@@ -0,0 +1,25 @@
|
||||
# CPM Dependencies Lock File
|
||||
# This file pins exact versions to ensure reproducible builds
|
||||
# Update versions here when upgrading dependencies
|
||||
|
||||
# Core dependencies
|
||||
set(SDL2_VERSION "2.30.0" CACHE STRING "SDL2 version")
|
||||
set(YAML_CPP_VERSION "0.8.0" CACHE STRING "yaml-cpp version")
|
||||
|
||||
# gRPC and related
|
||||
set(GRPC_VERSION "1.75.1" CACHE STRING "gRPC version")
|
||||
set(PROTOBUF_VERSION "3.25.1" CACHE STRING "Protobuf version")
|
||||
set(ABSEIL_VERSION "20240116.0" CACHE STRING "Abseil version")
|
||||
|
||||
# Testing
|
||||
set(GTEST_VERSION "1.14.0" CACHE STRING "Google Test version")
|
||||
set(BENCHMARK_VERSION "1.8.3" CACHE STRING "Google Benchmark version")
|
||||
|
||||
# CLI tools
|
||||
set(FTXUI_VERSION "5.0.0" CACHE STRING "FTXUI version")
|
||||
|
||||
# ImGui
|
||||
set(IMGUI_VERSION "1.90.4" CACHE STRING "Dear ImGui version")
|
||||
|
||||
# ASAR
|
||||
set(ASAR_VERSION "main" CACHE STRING "ASAR version")
|
||||
35
cmake/dependencies/ftxui.cmake
Normal file
35
cmake/dependencies/ftxui.cmake
Normal file
@@ -0,0 +1,35 @@
|
||||
# FTXUI dependency management for CLI tools
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
if(NOT YAZE_BUILD_CLI)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up FTXUI ${FTXUI_VERSION} with CPM.cmake")
|
||||
|
||||
# Use CPM to fetch FTXUI
|
||||
CPMAddPackage(
|
||||
NAME ftxui
|
||||
VERSION ${FTXUI_VERSION}
|
||||
GITHUB_REPOSITORY ArthurSonzogni/ftxui
|
||||
GIT_TAG v${FTXUI_VERSION}
|
||||
OPTIONS
|
||||
"FTXUI_BUILD_EXAMPLES OFF"
|
||||
"FTXUI_BUILD_TESTS OFF"
|
||||
"FTXUI_ENABLE_INSTALL OFF"
|
||||
)
|
||||
|
||||
# FTXUI targets are created during the build phase
|
||||
# We'll create our own interface target and link when available
|
||||
add_library(yaze_ftxui INTERFACE)
|
||||
|
||||
# Note: FTXUI targets will be available after the build phase
|
||||
# For now, we'll create a placeholder that can be linked later
|
||||
|
||||
# Export FTXUI targets for use in other CMake files
|
||||
set(YAZE_FTXUI_TARGETS yaze_ftxui)
|
||||
|
||||
message(STATUS "FTXUI setup complete")
|
||||
98
cmake/dependencies/grpc.cmake
Normal file
98
cmake/dependencies/grpc.cmake
Normal file
@@ -0,0 +1,98 @@
|
||||
# gRPC and Protobuf dependency management
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
if(NOT YAZE_ENABLE_GRPC)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Include CPM and dependencies lock
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up gRPC ${GRPC_VERSION} with CPM.cmake")
|
||||
|
||||
# Try to use system packages first if requested
|
||||
if(YAZE_USE_SYSTEM_DEPS)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(GRPC_PC grpc++)
|
||||
if(GRPC_PC_FOUND)
|
||||
message(STATUS "Using system gRPC via pkg-config")
|
||||
add_library(grpc::grpc++ INTERFACE IMPORTED)
|
||||
target_include_directories(grpc::grpc++ INTERFACE ${GRPC_PC_INCLUDE_DIRS})
|
||||
target_link_libraries(grpc::grpc++ INTERFACE ${GRPC_PC_LIBRARIES})
|
||||
target_compile_options(grpc::grpc++ INTERFACE ${GRPC_PC_CFLAGS_OTHER})
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use CPM to fetch gRPC with bundled dependencies
|
||||
CPMAddPackage(
|
||||
NAME grpc
|
||||
VERSION ${GRPC_VERSION}
|
||||
GITHUB_REPOSITORY grpc/grpc
|
||||
GIT_TAG v${GRPC_VERSION}
|
||||
OPTIONS
|
||||
"gRPC_BUILD_TESTS OFF"
|
||||
"gRPC_BUILD_CODEGEN ON"
|
||||
"gRPC_BUILD_GRPC_CPP_PLUGIN ON"
|
||||
"gRPC_BUILD_CSHARP_EXT OFF"
|
||||
"gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF"
|
||||
"gRPC_BUILD_GRPC_NODE_PLUGIN OFF"
|
||||
"gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN OFF"
|
||||
"gRPC_BUILD_GRPC_PHP_PLUGIN OFF"
|
||||
"gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF"
|
||||
"gRPC_BUILD_GRPC_RUBY_PLUGIN OFF"
|
||||
"gRPC_BUILD_REFLECTION OFF"
|
||||
"gRPC_BUILD_GRPC_REFLECTION OFF"
|
||||
"gRPC_BUILD_GRPC_CPP_REFLECTION OFF"
|
||||
"gRPC_BUILD_GRPCPP_REFLECTION OFF"
|
||||
"gRPC_BENCHMARK_PROVIDER none"
|
||||
"gRPC_ZLIB_PROVIDER package"
|
||||
"gRPC_PROTOBUF_PROVIDER module"
|
||||
"gRPC_ABSL_PROVIDER module"
|
||||
"protobuf_BUILD_TESTS OFF"
|
||||
"protobuf_BUILD_CONFORMANCE OFF"
|
||||
"protobuf_BUILD_EXAMPLES OFF"
|
||||
"protobuf_BUILD_PROTOC_BINARIES ON"
|
||||
"protobuf_WITH_ZLIB ON"
|
||||
"ABSL_PROPAGATE_CXX_STD ON"
|
||||
"ABSL_ENABLE_INSTALL ON"
|
||||
"ABSL_BUILD_TESTING OFF"
|
||||
"utf8_range_BUILD_TESTS OFF"
|
||||
"utf8_range_INSTALL OFF"
|
||||
)
|
||||
|
||||
# Verify gRPC targets are available
|
||||
if(NOT TARGET grpc::grpc++)
|
||||
message(FATAL_ERROR "gRPC target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET protoc)
|
||||
message(FATAL_ERROR "protoc target not found after gRPC setup")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET grpc_cpp_plugin)
|
||||
message(FATAL_ERROR "grpc_cpp_plugin target not found after gRPC setup")
|
||||
endif()
|
||||
|
||||
# Create convenience targets for the rest of the project
|
||||
add_library(yaze_grpc_support INTERFACE)
|
||||
target_link_libraries(yaze_grpc_support INTERFACE
|
||||
grpc::grpc++
|
||||
grpc::grpc++_reflection
|
||||
protobuf::libprotobuf
|
||||
)
|
||||
|
||||
# Export gRPC targets for use in other CMake files
|
||||
set(YAZE_GRPC_TARGETS
|
||||
grpc::grpc++
|
||||
grpc::grpc++_reflection
|
||||
protobuf::libprotobuf
|
||||
protoc
|
||||
grpc_cpp_plugin
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
message(STATUS "gRPC setup complete - targets available: ${YAZE_GRPC_TARGETS}")
|
||||
39
cmake/dependencies/imgui.cmake
Normal file
39
cmake/dependencies/imgui.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
# Dear ImGui dependency management
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up Dear ImGui ${IMGUI_VERSION} with CPM.cmake")
|
||||
|
||||
# Use CPM to fetch Dear ImGui
|
||||
CPMAddPackage(
|
||||
NAME imgui
|
||||
VERSION ${IMGUI_VERSION}
|
||||
GITHUB_REPOSITORY ocornut/imgui
|
||||
GIT_TAG v${IMGUI_VERSION}
|
||||
OPTIONS
|
||||
"IMGUI_BUILD_EXAMPLES OFF"
|
||||
"IMGUI_BUILD_DEMO OFF"
|
||||
)
|
||||
|
||||
# ImGui doesn't create targets during CPM fetch, they're created during build
|
||||
# We'll create our own interface target and link to ImGui when it's available
|
||||
add_library(yaze_imgui INTERFACE)
|
||||
|
||||
# Note: ImGui targets will be available after the build phase
|
||||
# For now, we'll create a placeholder that can be linked later
|
||||
|
||||
# Add platform-specific backends
|
||||
if(TARGET imgui_impl_sdl2)
|
||||
target_link_libraries(yaze_imgui INTERFACE imgui_impl_sdl2)
|
||||
endif()
|
||||
|
||||
if(TARGET imgui_impl_opengl3)
|
||||
target_link_libraries(yaze_imgui INTERFACE imgui_impl_opengl3)
|
||||
endif()
|
||||
|
||||
# Export ImGui targets for use in other CMake files
|
||||
set(YAZE_IMGUI_TARGETS yaze_imgui)
|
||||
|
||||
message(STATUS "Dear ImGui setup complete")
|
||||
76
cmake/dependencies/sdl2.cmake
Normal file
76
cmake/dependencies/sdl2.cmake
Normal file
@@ -0,0 +1,76 @@
|
||||
# SDL2 dependency management
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up SDL2 ${SDL2_VERSION} with CPM.cmake")
|
||||
|
||||
# Try to use system packages first if requested
|
||||
if(YAZE_USE_SYSTEM_DEPS)
|
||||
find_package(SDL2 QUIET)
|
||||
if(SDL2_FOUND)
|
||||
message(STATUS "Using system SDL2")
|
||||
add_library(yaze_sdl2 INTERFACE IMPORTED)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE SDL2::SDL2)
|
||||
if(TARGET SDL2::SDL2main)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE SDL2::SDL2main)
|
||||
endif()
|
||||
set(YAZE_SDL2_TARGETS yaze_sdl2 PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use CPM to fetch SDL2
|
||||
CPMAddPackage(
|
||||
NAME SDL2
|
||||
VERSION ${SDL2_VERSION}
|
||||
GITHUB_REPOSITORY libsdl-org/SDL
|
||||
GIT_TAG release-${SDL2_VERSION}
|
||||
OPTIONS
|
||||
"SDL_SHARED OFF"
|
||||
"SDL_STATIC ON"
|
||||
"SDL_TEST OFF"
|
||||
"SDL_INSTALL OFF"
|
||||
"SDL_CMAKE_DEBUG_POSTFIX d"
|
||||
)
|
||||
|
||||
# Verify SDL2 targets are available
|
||||
if(NOT TARGET SDL2::SDL2)
|
||||
message(FATAL_ERROR "SDL2 target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
# Create convenience targets for the rest of the project
|
||||
add_library(yaze_sdl2 INTERFACE)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE SDL2::SDL2)
|
||||
|
||||
# Add platform-specific libraries
|
||||
if(WIN32)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE
|
||||
winmm
|
||||
imm32
|
||||
version
|
||||
setupapi
|
||||
wbemuuid
|
||||
)
|
||||
target_compile_definitions(yaze_sdl2 INTERFACE SDL_MAIN_HANDLED)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE
|
||||
"-framework Cocoa"
|
||||
"-framework IOKit"
|
||||
"-framework CoreVideo"
|
||||
"-framework ForceFeedback"
|
||||
)
|
||||
target_compile_definitions(yaze_sdl2 INTERFACE SDL_MAIN_HANDLED)
|
||||
elseif(UNIX)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
||||
target_link_libraries(yaze_sdl2 INTERFACE ${GTK3_LIBRARIES})
|
||||
target_include_directories(yaze_sdl2 INTERFACE ${GTK3_INCLUDE_DIRS})
|
||||
target_compile_options(yaze_sdl2 INTERFACE ${GTK3_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
# Export SDL2 targets for use in other CMake files
|
||||
set(YAZE_SDL2_TARGETS yaze_sdl2)
|
||||
|
||||
message(STATUS "SDL2 setup complete")
|
||||
60
cmake/dependencies/testing.cmake
Normal file
60
cmake/dependencies/testing.cmake
Normal file
@@ -0,0 +1,60 @@
|
||||
# Testing dependencies (GTest, Benchmark)
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
if(NOT YAZE_BUILD_TESTS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up testing dependencies with CPM.cmake")
|
||||
|
||||
# Google Test
|
||||
CPMAddPackage(
|
||||
NAME googletest
|
||||
VERSION ${GTEST_VERSION}
|
||||
GITHUB_REPOSITORY google/googletest
|
||||
GIT_TAG v${GTEST_VERSION}
|
||||
OPTIONS
|
||||
"BUILD_GMOCK OFF"
|
||||
"INSTALL_GTEST OFF"
|
||||
"gtest_force_shared_crt ON"
|
||||
)
|
||||
|
||||
# Verify GTest targets are available
|
||||
if(NOT TARGET gtest)
|
||||
message(FATAL_ERROR "GTest target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
# Google Benchmark (optional, for performance tests)
|
||||
if(YAZE_ENABLE_COVERAGE OR DEFINED ENV{YAZE_ENABLE_BENCHMARKS})
|
||||
CPMAddPackage(
|
||||
NAME benchmark
|
||||
VERSION ${BENCHMARK_VERSION}
|
||||
GITHUB_REPOSITORY google/benchmark
|
||||
GIT_TAG v${BENCHMARK_VERSION}
|
||||
OPTIONS
|
||||
"BENCHMARK_ENABLE_TESTING OFF"
|
||||
"BENCHMARK_ENABLE_INSTALL OFF"
|
||||
)
|
||||
|
||||
if(NOT TARGET benchmark::benchmark)
|
||||
message(FATAL_ERROR "Benchmark target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
set(YAZE_BENCHMARK_TARGETS benchmark::benchmark PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Create convenience targets for the rest of the project
|
||||
add_library(yaze_testing INTERFACE)
|
||||
target_link_libraries(yaze_testing INTERFACE gtest)
|
||||
|
||||
if(TARGET benchmark::benchmark)
|
||||
target_link_libraries(yaze_testing INTERFACE benchmark::benchmark)
|
||||
endif()
|
||||
|
||||
# Export testing targets for use in other CMake files
|
||||
set(YAZE_TESTING_TARGETS yaze_testing)
|
||||
|
||||
message(STATUS "Testing dependencies setup complete")
|
||||
46
cmake/dependencies/yaml.cmake
Normal file
46
cmake/dependencies/yaml.cmake
Normal file
@@ -0,0 +1,46 @@
|
||||
# yaml-cpp dependency management
|
||||
# Uses CPM.cmake for consistent cross-platform builds
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
include(cmake/dependencies.lock)
|
||||
|
||||
message(STATUS "Setting up yaml-cpp ${YAML_CPP_VERSION} with CPM.cmake")
|
||||
|
||||
# Try to use system packages first if requested
|
||||
if(YAZE_USE_SYSTEM_DEPS)
|
||||
find_package(yaml-cpp QUIET)
|
||||
if(yaml-cpp_FOUND)
|
||||
message(STATUS "Using system yaml-cpp")
|
||||
add_library(yaze_yaml INTERFACE IMPORTED)
|
||||
target_link_libraries(yaze_yaml INTERFACE yaml-cpp)
|
||||
set(YAZE_YAML_TARGETS yaze_yaml PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use CPM to fetch yaml-cpp
|
||||
CPMAddPackage(
|
||||
NAME yaml-cpp
|
||||
VERSION ${YAML_CPP_VERSION}
|
||||
GITHUB_REPOSITORY jbeder/yaml-cpp
|
||||
GIT_TAG 0.8.0
|
||||
OPTIONS
|
||||
"YAML_CPP_BUILD_TESTS OFF"
|
||||
"YAML_CPP_BUILD_CONTRIB OFF"
|
||||
"YAML_CPP_BUILD_TOOLS OFF"
|
||||
"YAML_CPP_INSTALL OFF"
|
||||
)
|
||||
|
||||
# Verify yaml-cpp targets are available
|
||||
if(NOT TARGET yaml-cpp)
|
||||
message(FATAL_ERROR "yaml-cpp target not found after CPM fetch")
|
||||
endif()
|
||||
|
||||
# Create convenience targets for the rest of the project
|
||||
add_library(yaze_yaml INTERFACE)
|
||||
target_link_libraries(yaze_yaml INTERFACE yaml-cpp)
|
||||
|
||||
# Export yaml-cpp targets for use in other CMake files
|
||||
set(YAZE_YAML_TARGETS yaze_yaml)
|
||||
|
||||
message(STATUS "yaml-cpp setup complete")
|
||||
61
cmake/options.cmake
Normal file
61
cmake/options.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
# YAZE Build Options
|
||||
# Centralized feature flags and build configuration
|
||||
|
||||
# Core build options
|
||||
option(YAZE_BUILD_GUI "Build GUI application" ON)
|
||||
option(YAZE_BUILD_CLI "Build CLI tools (z3ed)" ON)
|
||||
option(YAZE_BUILD_EMU "Build emulator components" ON)
|
||||
option(YAZE_BUILD_LIB "Build static library" ON)
|
||||
option(YAZE_BUILD_TESTS "Build test suite" ON)
|
||||
|
||||
# Feature flags
|
||||
option(YAZE_ENABLE_GRPC "Enable gRPC agent support" ON)
|
||||
option(YAZE_ENABLE_JSON "Enable JSON support" ON)
|
||||
option(YAZE_ENABLE_AI "Enable AI agent features" ON)
|
||||
|
||||
# Build optimizations
|
||||
option(YAZE_ENABLE_LTO "Enable link-time optimization" OFF)
|
||||
option(YAZE_ENABLE_SANITIZERS "Enable AddressSanitizer/UBSanitizer" OFF)
|
||||
option(YAZE_ENABLE_COVERAGE "Enable code coverage" OFF)
|
||||
option(YAZE_UNITY_BUILD "Enable Unity (Jumbo) builds" OFF)
|
||||
|
||||
# Platform-specific options
|
||||
option(YAZE_USE_VCPKG "Use vcpkg for Windows dependencies" OFF)
|
||||
option(YAZE_USE_SYSTEM_DEPS "Use system package manager for dependencies" OFF)
|
||||
|
||||
# Development options
|
||||
option(YAZE_ENABLE_ROM_TESTS "Enable tests that require ROM files" OFF)
|
||||
option(YAZE_MINIMAL_BUILD "Minimal build for CI (disable optional features)" OFF)
|
||||
option(YAZE_VERBOSE_BUILD "Verbose build output" OFF)
|
||||
|
||||
# Install options
|
||||
option(YAZE_INSTALL_LIB "Install static library" OFF)
|
||||
option(YAZE_INSTALL_HEADERS "Install public headers" ON)
|
||||
|
||||
# Set preprocessor definitions based on options
|
||||
if(YAZE_ENABLE_GRPC)
|
||||
add_compile_definitions(YAZE_WITH_GRPC)
|
||||
endif()
|
||||
|
||||
if(YAZE_ENABLE_JSON)
|
||||
add_compile_definitions(YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
if(YAZE_ENABLE_AI)
|
||||
add_compile_definitions(Z3ED_AI)
|
||||
endif()
|
||||
|
||||
# Print configuration summary
|
||||
message(STATUS "=== YAZE Build Configuration ===")
|
||||
message(STATUS "GUI Application: ${YAZE_BUILD_GUI}")
|
||||
message(STATUS "CLI Tools: ${YAZE_BUILD_CLI}")
|
||||
message(STATUS "Emulator: ${YAZE_BUILD_EMU}")
|
||||
message(STATUS "Static Library: ${YAZE_BUILD_LIB}")
|
||||
message(STATUS "Tests: ${YAZE_BUILD_TESTS}")
|
||||
message(STATUS "gRPC Support: ${YAZE_ENABLE_GRPC}")
|
||||
message(STATUS "JSON Support: ${YAZE_ENABLE_JSON}")
|
||||
message(STATUS "AI Features: ${YAZE_ENABLE_AI}")
|
||||
message(STATUS "LTO: ${YAZE_ENABLE_LTO}")
|
||||
message(STATUS "Sanitizers: ${YAZE_ENABLE_SANITIZERS}")
|
||||
message(STATUS "Coverage: ${YAZE_ENABLE_COVERAGE}")
|
||||
message(STATUS "=================================")
|
||||
34
cmake/packaging/cpack.cmake
Normal file
34
cmake/packaging/cpack.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
# CPack Configuration
|
||||
# Cross-platform packaging using CPack
|
||||
|
||||
include(CPack)
|
||||
|
||||
# Set package information
|
||||
set(CPACK_PACKAGE_NAME "yaze")
|
||||
set(CPACK_PACKAGE_VENDOR "scawful")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Yet Another Zelda3 Editor")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${YAZE_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${YAZE_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${YAZE_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_VERSION "${YAZE_VERSION_MAJOR}.${YAZE_VERSION_MINOR}.${YAZE_VERSION_PATCH}")
|
||||
|
||||
# Set package directory
|
||||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")
|
||||
|
||||
# Platform-specific packaging
|
||||
if(APPLE)
|
||||
include(cmake/packaging/macos.cmake)
|
||||
elseif(WIN32)
|
||||
include(cmake/packaging/windows.cmake)
|
||||
elseif(UNIX)
|
||||
include(cmake/packaging/linux.cmake)
|
||||
endif()
|
||||
|
||||
# Common files to include
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
|
||||
# Set default component
|
||||
set(CPACK_COMPONENTS_ALL yaze)
|
||||
set(CPACK_COMPONENT_YAZE_DISPLAY_NAME "YAZE Editor")
|
||||
set(CPACK_COMPONENT_YAZE_DESCRIPTION "Main YAZE application and libraries")
|
||||
16
cmake/packaging/linux.cmake
Normal file
16
cmake/packaging/linux.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
# Linux Packaging Configuration
|
||||
|
||||
# DEB package
|
||||
set(CPACK_GENERATOR "DEB;TGZ")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "scawful")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libstdc++6, libsdl2-2.0-0")
|
||||
|
||||
# RPM package
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Applications/Games")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "glibc, libstdc++, SDL2")
|
||||
|
||||
# Tarball
|
||||
set(CPACK_TGZ_PACKAGE_NAME "yaze-${CPACK_PACKAGE_VERSION}-linux-x64")
|
||||
23
cmake/packaging/macos.cmake
Normal file
23
cmake/packaging/macos.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
# macOS Packaging Configuration
|
||||
|
||||
# Create .dmg package
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
set(CPACK_DMG_VOLUME_NAME "yaze")
|
||||
set(CPACK_DMG_FORMAT "UDZO")
|
||||
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/assets/yaze.png")
|
||||
|
||||
# App bundle configuration
|
||||
set(CPACK_BUNDLE_NAME "yaze")
|
||||
set(CPACK_BUNDLE_PACKAGE_TYPE "APPL")
|
||||
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/assets/yaze.icns")
|
||||
|
||||
# Code signing (if available)
|
||||
if(DEFINED ENV{CODESIGN_IDENTITY})
|
||||
set(CPACK_BUNDLE_APPLE_CERT_APP "$ENV{CODESIGN_IDENTITY}")
|
||||
set(CPACK_BUNDLE_APPLE_CODESIGN_FORCE "ON")
|
||||
endif()
|
||||
|
||||
# Notarization (if available)
|
||||
if(DEFINED ENV{NOTARIZATION_CREDENTIALS})
|
||||
set(CPACK_BUNDLE_APPLE_NOTARIZATION_CREDENTIALS "$ENV{NOTARIZATION_CREDENTIALS}")
|
||||
endif()
|
||||
21
cmake/packaging/windows.cmake
Normal file
21
cmake/packaging/windows.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
# Windows Packaging Configuration
|
||||
|
||||
# NSIS installer
|
||||
set(CPACK_GENERATOR "NSIS;ZIP")
|
||||
set(CPACK_NSIS_PACKAGE_NAME "YAZE Editor")
|
||||
set(CPACK_NSIS_DISPLAY_NAME "YAZE Editor v${CPACK_PACKAGE_VERSION}")
|
||||
set(CPACK_NSIS_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
|
||||
set(CPACK_NSIS_CONTACT "scawful")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/scawful/yaze")
|
||||
set(CPACK_NSIS_HELP_LINK "https://github.com/scawful/yaze")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/scawful/yaze")
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
|
||||
# ZIP package
|
||||
set(CPACK_ZIP_PACKAGE_NAME "yaze-${CPACK_PACKAGE_VERSION}-windows-x64")
|
||||
|
||||
# Code signing (if available)
|
||||
if(DEFINED ENV{SIGNTOOL_CERTIFICATE})
|
||||
set(CPACK_NSIS_SIGN_TOOL "signtool.exe")
|
||||
set(CPACK_NSIS_SIGN_COMMAND "${ENV{SIGNTOOL_CERTIFICATE}}")
|
||||
endif()
|
||||
21
cmake/toolchains/linux-gcc.cmake
Normal file
21
cmake/toolchains/linux-gcc.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
# Linux GCC Toolchain
|
||||
# Optimized for Ubuntu 22.04+ with GCC 12+
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_C_COMPILER gcc)
|
||||
set(CMAKE_CXX_COMPILER g++)
|
||||
|
||||
# Set C++ standard
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Compiler flags
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||
|
||||
# Link flags
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
|
||||
|
||||
# Find packages
|
||||
find_package(PkgConfig REQUIRED)
|
||||
24
cmake/toolchains/macos-clang.cmake
Normal file
24
cmake/toolchains/macos-clang.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# macOS Clang Toolchain
|
||||
# Optimized for macOS 14+ with Clang 18+
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
|
||||
# Set C++ standard
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# macOS deployment target
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "macOS deployment target")
|
||||
|
||||
# Compiler flags
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||
|
||||
# Link flags
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
|
||||
# Find packages
|
||||
find_package(PkgConfig REQUIRED)
|
||||
25
cmake/toolchains/windows-msvc.cmake
Normal file
25
cmake/toolchains/windows-msvc.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
# Windows MSVC Toolchain
|
||||
# Optimized for Visual Studio 2022 with MSVC 19.30+
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_C_COMPILER cl)
|
||||
set(CMAKE_CXX_COMPILER cl)
|
||||
|
||||
# Set C++ standard
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# MSVC runtime library (static)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
# Compiler flags
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /permissive-")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Ob2 /DNDEBUG")
|
||||
|
||||
# Link flags
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
||||
|
||||
# Windows-specific definitions
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
add_definitions(-DNOMINMAX)
|
||||
Reference in New Issue
Block a user