mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-11 16:36:59 +00:00
Big Commit
The changes affects multiple places in the repo and this one of the rare instances where I cant be bothered writing a comprehensive commit. Look at the diff for changes. Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
4dd8506346
commit
6bdfd6fcea
10 changed files with 669 additions and 25 deletions
|
|
@ -14,6 +14,7 @@ set(CMAKE_C_STANDARD 17)
|
|||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_C_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
#-------------------------------
|
||||
# ---- Dependency Discovery ----
|
||||
|
|
@ -23,14 +24,73 @@ find_package(OpenGL REQUIRED)
|
|||
find_package(fmt 10.2.1 CONFIG)
|
||||
find_package(SDL3 3.2.10 CONFIG)
|
||||
|
||||
message(STATUS "Verifying Git submodules integrity...")
|
||||
|
||||
# Check if submodules are properly initialized.
|
||||
execute_process(
|
||||
COMMAND git submodule status
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE submodule_status
|
||||
RESULT_VARIABLE result
|
||||
)
|
||||
|
||||
if(NOT result EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to get submodule status")
|
||||
endif()
|
||||
|
||||
# Function to verify a specific submodule's pinned commit
|
||||
function(verify_pinned_commit name path actual_commit expected_commit)
|
||||
if(NOT actual_commit STREQUAL expected_commit)
|
||||
message(FATAL_ERROR
|
||||
"${name} submodule commit mismatch!\n"
|
||||
"Path: ${path}\n"
|
||||
"Expected: ${expected_commit}\n"
|
||||
"Actual: ${actual_commit}\n"
|
||||
"Submodule may have been updated. Please revert to pinned commit with:\n"
|
||||
" cd ${path}\n"
|
||||
" git checkout ${expected_commit}\n"
|
||||
" cd ../..\n"
|
||||
" git add ${path}\n"
|
||||
" git commit -m \"Revert ${name} to pinned commit\""
|
||||
)
|
||||
endif()
|
||||
|
||||
message(STATUS "${name} commit matches pinned version: ${expected_commit}")
|
||||
endfunction()
|
||||
|
||||
# Parse submodule status and verify each one
|
||||
string(REPLACE "\n" ";" submodule_lines ${submodule_status})
|
||||
foreach(line ${submodule_lines})
|
||||
# Extract status character (first character)
|
||||
string(SUBSTRING ${line} 0 1 status_char)
|
||||
|
||||
# Extract commit hash
|
||||
string(REGEX REPLACE "^([ +-])([0-9a-f]+) .*" "\\2" commit_hash ${line})
|
||||
|
||||
# Extract path
|
||||
string(REGEX REPLACE "^[ +-][0-9a-f]+ ([^ ]+).*" "\\1" submodule_path ${line})
|
||||
|
||||
if(status_char STREQUAL "-")
|
||||
message(FATAL_ERROR "Submodule ${submodule_path} is not initialized. Please run: git submodule update --init --recursive")
|
||||
elseif(status_char STREQUAL "+")
|
||||
message(WARNING "Submodule ${submodule_path} has uncommitted chamges")
|
||||
endif()
|
||||
# Verify pinned commit for known submodules
|
||||
if(submodule_path STREQUAL "3rd_Party/imgui")
|
||||
verify_pinned_commit("imgui" "${submodule_path}" "${commit_hash}" "bf75bfec48fc00f532af8926130b70c0e26eb099")
|
||||
elseif(submodule_path STREQUAL "3rd_Party/SDL3")
|
||||
verify_pinned_commit("SDL3" "${submodule_path}" "${commit_hash}" "a96677bdf6b4acb84af4ec294e5f60a4e8cbbe03")
|
||||
endif()
|
||||
|
||||
message(STATUS "Verified submodule: ${submodule_path} (${commit_hash})")
|
||||
endforeach()
|
||||
|
||||
message(STATUS "All submodules verified successfully")
|
||||
|
||||
#-----------------------------
|
||||
# ---- Target Definitions ----
|
||||
#-----------------------------
|
||||
|
||||
if(WIN32)
|
||||
add_compile_options(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
||||
endif()
|
||||
|
||||
add_executable(Pound
|
||||
src/main.cpp
|
||||
)
|
||||
|
|
@ -46,6 +106,10 @@ add_subdirectory(src/targets/switch1/hardware)
|
|||
# ---- Target Configurations ----
|
||||
#--------------------------------
|
||||
|
||||
if(WIN32)
|
||||
add_compile_options(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
||||
endif()
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
||||
|
||||
|
|
@ -78,8 +142,6 @@ foreach(TARGET ${POUND_PROJECT_TARGETS})
|
|||
target_compile_definitions(${TARGET} PRIVATE COMPILE_TIME_LOG_LEVEL=1)
|
||||
endforeach()
|
||||
|
||||
|
||||
|
||||
# Optimizations
|
||||
set_property(TARGET Pound PROPERTY CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
|
||||
if (WIN32)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue