fix Windows NOMINMAX and _CRT_SECURE_NO_WARNINGS redefinitions

This commit is contained in:
SimoneN64
2023-06-06 11:28:45 +02:00
parent ca5d431770
commit 25376f06af
5 changed files with 13 additions and 15 deletions

View File

@@ -14,11 +14,8 @@ add_library(imgui
add_compile_definitions(IMGUI_IMPL_VULKAN_NO_PROTOTYPES) add_compile_definitions(IMGUI_IMPL_VULKAN_NO_PROTOTYPES)
if(WIN32) if(MSVC)
target_compile_definitions(imgui PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS)
if(MSVC)
target_compile_options(imgui PUBLIC /EHa) target_compile_options(imgui PUBLIC /EHa)
endif()
endif() endif()
target_include_directories(imgui PUBLIC ../parallel-rdp/parallel-rdp-standalone/volk target_include_directories(imgui PUBLIC ../parallel-rdp/parallel-rdp-standalone/volk

View File

@@ -45,7 +45,7 @@ add_library(parallel-rdp
) )
if(WIN32) if(WIN32)
target_compile_definitions(parallel-rdp PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS VK_USE_PLATFORM_WIN32_KHR) target_compile_definitions(parallel-rdp PUBLIC VK_USE_PLATFORM_WIN32_KHR)
if(MSVC) if(MSVC)
target_compile_options(parallel-rdp PUBLIC /EHa) target_compile_options(parallel-rdp PUBLIC /EHa)
endif() endif()

View File

@@ -39,6 +39,10 @@ include_directories(
) )
add_compile_definitions(SIMD_SUPPORT) add_compile_definitions(SIMD_SUPPORT)
if(WIN32)
add_definitions(-DNOMINMAX)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif ()
add_compile_options(-mssse3 -msse4.1) add_compile_options(-mssse3 -msse4.1)
if(${CMAKE_BUILD_TYPE} MATCHES Debug) if(${CMAKE_BUILD_TYPE} MATCHES Debug)
#add_compile_options(-fsanitize=address -fsanitize=undefined) #add_compile_options(-fsanitize=address -fsanitize=undefined)
@@ -60,6 +64,10 @@ add_subdirectory(../external/parallel-rdp parallel-rdp)
add_executable(kaizen main.cpp) add_executable(kaizen main.cpp)
if(MSVC)
target_compile_options(parallel-rdp PUBLIC /EHa)
endif()
file(COPY ${PROJECT_SOURCE_DIR}/../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/) file(COPY ${PROJECT_SOURCE_DIR}/../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/)
file(REMOVE file(REMOVE
${PROJECT_BINARY_DIR}/resources/mario.png ${PROJECT_BINARY_DIR}/resources/mario.png
@@ -68,10 +76,3 @@ file(REMOVE
target_link_libraries(kaizen PUBLIC frontend frontend-imgui target_link_libraries(kaizen PUBLIC frontend frontend-imgui
discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core registers interpreter mmio rsp SDL2::SDL2main SDL2::SDL2) discord-rpc imgui nfd parallel-rdp backend fmt::fmt nlohmann_json::nlohmann_json core registers interpreter mmio rsp SDL2::SDL2main SDL2::SDL2)
if(WIN32)
target_compile_definitions(kaizen PUBLIC NOMINMAX _CRT_SECURE_NO_WARNINGS)
if(MSVC)
target_compile_options(parallel-rdp PUBLIC /EHa)
endif()
endif()

View File

@@ -65,7 +65,7 @@ void Core::Run(float volumeL, float volumeR) {
cycles += taken; cycles += taken;
frameCycles += taken; frameCycles += taken;
scheduler.tick(1, mem, regs); scheduler.tick(taken, mem, regs);
} }
cycles -= mmio.vi.cyclesPerHalfline; cycles -= mmio.vi.cyclesPerHalfline;