Files
louist103andGitHub 53a060be59 Windows ARM64 support (#899)
* WIP Arm 64

# Conflicts:
#	src/graphic/Fast3D/backends/gfx_opengl.cpp

* Some cleanups.

* oops

* Update prism

Fix

* Prism fixes

* Format

* arm64 actions

* Fix dx11

* Use Visuall studio build system

* Fix paths?

* Fix actions again?

* Update build-validation.yml
2025-08-07 10:20:23 -04:00

113 lines
3.8 KiB
CMake

include(FetchContent)
find_package(OpenGL QUIET)
#=================== ImGui ===================
set(imgui_fixes_and_config_patch_file ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/patches/imgui-fixes-and-config.patch)
set(imgui_apply_patch_command ${CMAKE_COMMAND} -Dpatch_file=${imgui_fixes_and_config_patch_file} -Dwith_reset=TRUE -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/git-patch.cmake)
FetchContent_Declare(
ImGui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.91.9b-docking
PATCH_COMMAND ${imgui_apply_patch_command}
)
FetchContent_MakeAvailable(ImGui)
list(APPEND ADDITIONAL_LIB_INCLUDES ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)
add_library(ImGui STATIC)
set_property(TARGET ImGui PROPERTY CXX_STANDARD 20)
target_sources(ImGui
PRIVATE
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/imgui.cpp
)
target_sources(ImGui
PRIVATE
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_sdl2.cpp
)
target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends PRIVATE ${SDL2_INCLUDE_DIRS})
# ========= StormLib =============
if(INCLUDE_MPQ_SUPPORT)
set(stormlib_patch_file ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/patches/stormlib-optimizations.patch)
set(stormlib_apply_patch_command ${CMAKE_COMMAND} -Dpatch_file=${stormlib_patch_file} -Dwith_reset=TRUE -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/git-patch.cmake)
FetchContent_Declare(
StormLib
GIT_REPOSITORY https://github.com/ladislav-zezula/StormLib.git
GIT_TAG v9.25
PATCH_COMMAND ${stormlib_apply_patch_command}
)
FetchContent_MakeAvailable(StormLib)
list(APPEND ADDITIONAL_LIB_INCLUDES ${stormlib_SOURCE_DIR}/src)
endif()
#=================== STB ===================
set(STB_DIR ${CMAKE_BINARY_DIR}/_deps/stb)
file(DOWNLOAD "https://github.com/nothings/stb/raw/0bc88af4de5fb022db643c2d8e549a0927749354/stb_image.h" "${STB_DIR}/stb_image.h")
file(WRITE "${STB_DIR}/stb_impl.c" "#define STB_IMAGE_IMPLEMENTATION\n#include \"stb_image.h\"")
add_library(stb STATIC)
target_sources(stb PRIVATE
${STB_DIR}/stb_image.h
${STB_DIR}/stb_impl.c
)
target_include_directories(stb PUBLIC ${STB_DIR})
list(APPEND ADDITIONAL_LIB_INCLUDES ${STB_DIR})
#=================== libgfxd ===================
if (GFX_DEBUG_DISASSEMBLER)
FetchContent_Declare(
libgfxd
GIT_REPOSITORY https://github.com/glankk/libgfxd.git
GIT_TAG 008f73dca8ebc9151b205959b17773a19c5bd0da
)
FetchContent_MakeAvailable(libgfxd)
add_library(libgfxd STATIC)
set_property(TARGET libgfxd PROPERTY C_STANDARD 11)
target_sources(libgfxd PRIVATE
${libgfxd_SOURCE_DIR}/gbi.h
${libgfxd_SOURCE_DIR}/gfxd.h
${libgfxd_SOURCE_DIR}/priv.h
${libgfxd_SOURCE_DIR}/gfxd.c
${libgfxd_SOURCE_DIR}/uc.c
${libgfxd_SOURCE_DIR}/uc_f3d.c
${libgfxd_SOURCE_DIR}/uc_f3db.c
${libgfxd_SOURCE_DIR}/uc_f3dex.c
${libgfxd_SOURCE_DIR}/uc_f3dex2.c
${libgfxd_SOURCE_DIR}/uc_f3dexb.c
)
target_include_directories(libgfxd PUBLIC ${libgfxd_SOURCE_DIR})
endif()
#======== thread-pool ========
FetchContent_Declare(
ThreadPool
GIT_REPOSITORY https://github.com/bshoshany/thread-pool.git
GIT_TAG v4.1.0
)
FetchContent_MakeAvailable(ThreadPool)
list(APPEND ADDITIONAL_LIB_INCLUDES ${threadpool_SOURCE_DIR}/include)
#=========== prism ===========
option(PRISM_STANDALONE "Build prism as a standalone library" OFF)
FetchContent_Declare(
prism
GIT_REPOSITORY https://github.com/KiritoDv/prism-processor.git
GIT_TAG bbcbc7e3f890a5806b579361e7aa0336acd547e7
)
FetchContent_MakeAvailable(prism)