Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 #24

Open
wants to merge 10 commits into
base: mmcs-rebase
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")

if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32" OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64"))
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
endif()
endif()
Expand Down Expand Up @@ -88,8 +88,4 @@ if (NOT TARGET ZAPD)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
endif()

if (NOT TARGET ZAPDUtils)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
endif()

add_subdirectory(OTRExporter)
76 changes: 14 additions & 62 deletions OTRExporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,15 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_target_properties(${PROJECT_NAME} PROPERTIES
VS_GLOBAL_KEYWORD "Win32Proj"
)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
endif()
################################################################################
# MSVC runtime library
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32" OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
$<$<CONFIG:Debug>:
MultiThreadedDebug
Expand All @@ -107,14 +100,12 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
>
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
endif()
################################################################################
# Compile definitions
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG"
Expand All @@ -126,20 +117,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
"_CRT_SECURE_NO_WARNINGS;"
STORMLIB_NO_AUTO_LINK
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG;"
"_CRT_SECURE_NO_WARNINGS"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"WIN32;"
"_CONSOLE;"
STORMLIB_NO_AUTO_LINK
)
endif()
endif()

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
Expand All @@ -165,11 +142,6 @@ target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/Mercury
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/tinyxml2
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/StormLib/src
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
${CMAKE_CURRENT_SOURCE_DIR}/../../mm/2s2h
.
Expand All @@ -178,8 +150,18 @@ target_include_directories(${PROJECT_NAME} PRIVATE
find_package(nlohmann_json REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC nlohmann_json::nlohmann_json)

find_package(spdlog REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog)

FetchContent_Declare(
StormLib
GIT_REPOSITORY https://github.com/ladislav-zezula/StormLib.git
GIT_TAG v9.25
)
FetchContent_MakeAvailable(StormLib)
target_include_directories(${PROJECT_NAME} PRIVATE ${stormlib_SOURCE_DIR}/src)

if(MSVC)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/Od;
Expand All @@ -195,42 +177,13 @@ if(MSVC)
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/Od;
/Oi-
>
$<$<CONFIG:Release>:
/Oi;
/Gy
>
/permissive-;
/sdl;
/W3;
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
endif()
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/OPT:REF;
/OPT:ICF
>
/SUBSYSTEM:CONSOLE
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/DEBUG;
/OPT:REF;
/OPT:ICF;
/INCREMENTAL:NO
>
/SUBSYSTEM:CONSOLE
)
endif()
endif()

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
Expand All @@ -254,4 +207,3 @@ add_dependencies(${PROJECT_NAME}

# Link with other targets.
target_link_libraries(${PROJECT_NAME} PUBLIC "${ADDITIONAL_LIBRARY_DEPENDENCIES}")

2 changes: 1 addition & 1 deletion OTRExporter/DisplayListExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../ZAPD/ZFile.h"
#include <Utils/MemoryStream.h>
#include <Utils/BitConverter.h>
#include "StrHash64/StrHash64.h"
#include <utils/StrHash64.h>
#include "spdlog/spdlog.h"
#include <libultraship/libultra/gbi.h>
#include <Globals.h>
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter/ExporterArchive.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ExporterArchive.h"
#include "Utils/StringHelper.h"
#include <StrHash64/StrHash64.h>
#include <utils/StrHash64.h>
#include <filesystem>

ExporterArchive::ExporterArchive(const std::string& path, bool enableWriting) : mPath(path) {
Expand Down