From dadf7414ee87ff64d9da433b67a3a7c555f9c76c Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Wed, 31 Jan 2024 14:50:31 -0600 Subject: [PATCH] Fixed windows issues --- CMakeLists.txt | 13 +++++++------ src/factories/sm64/GeoLayoutFactory.cpp | 2 +- src/factories/sm64/geo/GeoCommand.h | 2 +- src/utils/TorchUtils.h | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87a960ce..a3fc3560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(torch) include(FetchContent) set(CMAKE_CXX_STANDARD 20) +set(CMAKE_C_STANDARD 11) # Link libgfxd # Because libgfxd is not a CMake project, we have to manually fetch it and add it to the build @@ -55,13 +56,13 @@ else() $<$: /w; /Od; - /MTd + /MDd > $<$: /Oi; /Gy; /W3; - /MT + /MD > /permissive-; /MP; @@ -72,13 +73,13 @@ else() elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32") target_compile_options(${PROJECT_NAME} PRIVATE $<$: - /MTd + /MDd > $<$: /O2; /Oi; /Gy; - /MT + /MD > /permissive-; /MP; @@ -100,7 +101,7 @@ else() > /MANIFEST:NO; /DEBUG; - /SUBSYSTEM:WINDOWS + /SUBSYSTEM:CONSOLE ) elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32") target_link_options(${PROJECT_NAME} PRIVATE @@ -115,7 +116,7 @@ else() > /MANIFEST:NO; /DEBUG; - /SUBSYSTEM:WINDOWS + /SUBSYSTEM:CONSOLE ) endif() endif() diff --git a/src/factories/sm64/GeoLayoutFactory.cpp b/src/factories/sm64/GeoLayoutFactory.cpp index 520b9736..844b8fb1 100644 --- a/src/factories/sm64/GeoLayoutFactory.cpp +++ b/src/factories/sm64/GeoLayoutFactory.cpp @@ -555,7 +555,7 @@ std::optional> SM64::GeoLayoutFactory::parse(std::v } } - commands.push_back({opcode, arguments}); + commands.push_back({ opcode, arguments }); } return std::make_shared(commands); diff --git a/src/factories/sm64/geo/GeoCommand.h b/src/factories/sm64/geo/GeoCommand.h index 66526dcb..2bad32d1 100644 --- a/src/factories/sm64/geo/GeoCommand.h +++ b/src/factories/sm64/geo/GeoCommand.h @@ -199,7 +199,7 @@ inline std::ostream& operator<<(std::ostream& out, const GeoOpcode& opcode) { BSWAP32((*(s32 *) &cmd[CMD_PROCESS_OFFSET(offset)])) #define cur_geo_cmd_u32(offset) \ - BSWAP32((*(uint32_t *) &cmd[CMD_PROCESS_OFFSET(offset)])) + (uint32_t) BSWAP32((*(uint32_t *) &cmd[CMD_PROCESS_OFFSET(offset)])) class GeoLayoutCommand { public: diff --git a/src/utils/TorchUtils.h b/src/utils/TorchUtils.h index e3d89e67..6c8b6c4f 100644 --- a/src/utils/TorchUtils.h +++ b/src/utils/TorchUtils.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace Torch { template< typename T >