diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 014abedc..ae5e9d8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,15 +41,18 @@ jobs: submodules: recursive - name: Setup dependencies run: | - vcpkg install sdl2[vulkan]:x64-windows-static + vcpkg install sdl2[vulkan]:x64-windows + vcpkg install fmt:x64-windows + vcpkg install nlohmann-json:x64-windows + vcpkg install vulkan:x64-windows - name: Build natsukashii run: | - cmake -B build -T clangcl -DCAPSTONE_ARCHITECTURE_DEFAULT=OFF -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_MIPS_SUPPORT=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -S src + cmake -B build -T clangcl -DCAPSTONE_ARCHITECTURE_DEFAULT=OFF -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_MIPS_SUPPORT=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -S src cmake --build . --config Release - name: Collect artifacts run: | mkdir upload - cp -r build/{natsukashii.exe,resources,SDL2.dll} upload + cp -r build/{natsukashii.exe,resources,SDL2.dll,fmt.dll} upload - name: Upload artifacts uses: actions/upload-artifact@v2 with: diff --git a/external/fmt b/external/fmt deleted file mode 160000 index 80f8d344..00000000 --- a/external/fmt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 80f8d34427d40ec5e7ce3b10ededc46bd4bd5759 diff --git a/external/imgui/CMakeLists.txt b/external/imgui/CMakeLists.txt index 8ff38525..abce5b10 100644 --- a/external/imgui/CMakeLists.txt +++ b/external/imgui/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.20) project(imgui) -find_package(SDL2 REQUIRED) +find_package(Vulkan REQUIRED) +find_package(SDL2 CONFIG REQUIRED) add_library(imgui imgui/imgui_demo.cpp @@ -17,12 +18,11 @@ add_library(imgui imgui/backends/imgui_impl_vulkan.h imgui/backends/imgui_impl_vulkan.cpp) + if(WIN32) - target_compile_options(imgui PUBLIC -mwindows) - set(LIBRARIES -static z stdc++ user32 gdi32 winmm Imm32 ole32 oleaut32 shell32 setupapi version uuid) -else() - set(LIBRARIES ) + add_compile_definitions(NOMINMAX _CRT_SECURE_NO_WARNINGS) + add_compile_options(/EHa) endif() -target_include_directories(imgui PUBLIC ${SDL2_INCLUDE_DIRS} imgui imgui/backends) -target_link_libraries(imgui PUBLIC ${SDL2_LIBRARIES} ${LIBRARIES}) \ No newline at end of file +target_include_directories(imgui PUBLIC ${SDL2_INCLUDE_DIR} ${Vulkan_INCLUDE_DIRS} imgui imgui/backends) +target_link_libraries(imgui PUBLIC SDL2::SDL2main SDL2::SDL2 Vulkan::Vulkan) \ No newline at end of file diff --git a/external/nativefiledialog-extended b/external/nativefiledialog-extended index 31df8e30..74923e7c 160000 --- a/external/nativefiledialog-extended +++ b/external/nativefiledialog-extended @@ -1 +1 @@ -Subproject commit 31df8e30cc14c6929033152ffd61dd1c98b4f5b3 +Subproject commit 74923e7c0cc19fec1b789e78c033c211300e4a01 diff --git a/external/parallel-rdp/CMakeLists.txt b/external/parallel-rdp/CMakeLists.txt index d35c3ca4..bdf61682 100644 --- a/external/parallel-rdp/CMakeLists.txt +++ b/external/parallel-rdp/CMakeLists.txt @@ -52,7 +52,8 @@ add_library(parallel-rdp target_compile_definitions(parallel-rdp PUBLIC GRANITE_VULKAN_MT) target_include_directories(parallel-rdp PUBLIC - ${SDL2_INCLUDE_DIRS} + ${SDL2_INCLUDE_DIR} + ${Vulkan_INCLUDE_DIR} parallel-rdp-standalone/parallel-rdp parallel-rdp-standalone/volk parallel-rdp-standalone/spirv-cross @@ -78,7 +79,12 @@ target_include_directories(parallel-rdp PUBLIC . ) -target_link_libraries(parallel-rdp SDL2::SDL2main SDL2::SDL2-static) +if(WIN32) + add_compile_definitions(NOMINMAX _CRT_SECURE_NO_WARNINGS) + add_compile_options(/EHa) +endif() + +target_link_libraries(parallel-rdp Vulkan::Vulkan SDL2::SDL2main SDL2::SDL2) if(WIN32) target_compile_definitions(parallel-rdp PUBLIC VK_USE_PLATFORM_WIN32_KHR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ea95e1b..a078aceb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,12 +9,10 @@ file(GLOB_RECURSE CORE_HEADERS n64/*.hpp) file(GLOB_RECURSE FRONTEND_SOURCES frontend/*.cpp) file(GLOB_RECURSE FRONTEND_HEADERS frontend/*.hpp) +find_package(fmt REQUIRED) find_package(SDL2 REQUIRED) find_package(nlohmann_json REQUIRED) -set(FMT_TEST BOOL "" FORCE OFF) - -add_subdirectory(../external/fmt fmt) add_subdirectory(../external/capstone capstone) add_subdirectory(../external/parallel-rdp prdp) add_subdirectory(../external/imgui imgui) @@ -46,21 +44,18 @@ target_include_directories(natsukashii PRIVATE ../external/parallel-rdp/ ../external/nativefiledialog-extended/src/include ../external/capstone/include - ../external/fmt/include ${SDL2_INCLUDE_DIR} ) -if(${CMAKE_BUILD_TYPE} MATCHES Release) - target_compile_options(natsukashii PRIVATE -Ofast) -elseif(${CMAKE_BUILD_TYPE} MATCHES Debug) - target_compile_options(natsukashii PRIVATE -g) -endif() - file(COPY ${PROJECT_SOURCE_DIR}/../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/) file(REMOVE ${PROJECT_BINARY_DIR}/resources/mario.png ${PROJECT_BINARY_DIR}/resources/shader.frag ${PROJECT_BINARY_DIR}/resources/shader.vert) -target_link_libraries(natsukashii PRIVATE SDL2::SDL2main SDL2::SDL2-static capstone-static nfd parallel-rdp imgui fmt::fmt nlohmann_json::nlohmann_json) -target_compile_options(natsukashii PRIVATE -mssse3 -msse4.1) \ No newline at end of file +if(WIN32) + add_compile_definitions(NOMINMAX _CRT_SECURE_NO_WARNINGS) + add_compile_options(/EHa) +endif() + +target_link_libraries(natsukashii PRIVATE SDL2::SDL2main SDL2::SDL2 capstone-static nfd parallel-rdp fmt::fmt imgui nlohmann_json::nlohmann_json) \ No newline at end of file