Skip to content

Commit

Permalink
Merge pull request #57 from FrederoxDev/version/1.2.0
Browse files Browse the repository at this point in the history
Move Version/1.2.0 into stable
  • Loading branch information
FrederoxDev authored Feb 13, 2024
2 parents 2870720 + 9ec5f9c commit 86083c8
Show file tree
Hide file tree
Showing 98 changed files with 70,436 additions and 6,308 deletions.
7 changes: 0 additions & 7 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"detail": "Build the Amethyst API",
"problemMatcher": []
},
{
"type": "shell",
"label": "Build and Run Launcher",
"command": "cd AmethystLauncher; mkdir build; cd build; cmake ..; msbuild AmethystLauncher.sln; cd RelWithDebInfo; ./AmethystLauncher.exe",
"detail": "Build and run the Amethyst Launcher",
"problemMatcher": []
},
{
"type": "shell",
"label": "Build Runtime",
Expand Down
2 changes: 2 additions & 0 deletions AmethystAPI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/cmake-build-relwithdebinfo-visual-studio
/.idea
31 changes: 18 additions & 13 deletions AmethystAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
cmake_minimum_required(VERSION 3.12)
project(AmethystAPI)

project(AmethystAPI CXX ASM_NASM)
include(FetchContent)

# Amethyst folder location
set(AmethystFolder "$ENV{localappdata}/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/AC/Amethyst/")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${AmethystFolder}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${AmethystFolder}/lib")

# C++ Compile Options
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" CACHE STRING "Build configurations" FORCE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: RelWithDebInfo" FORCE)

file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE HEADERS "src/*.h")
file(GLOB_RECURSE ASM "src/*.asm")
add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
set_property(GLOBAL PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")

file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.c" "src/*.asm")
file(GLOB_RECURSE HEADERS "src/*.h" "src/*.hpp")

# Create AmethystAPI as a .lib
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${ASM} ${HEADERS})
add_library(${PROJECT_NAME} STATIC
${SOURCES}
${HEADERS}
src/minecraft/src/common/world/item/Item.asm
src/minecraft/src/common/world/level/block/BlockLegacy.asm
src/minecraft/src-client/common/client/renderer/block/BlockGraphics.h
)

# Amethyst Dependencies
target_include_directories(${PROJECT_NAME} PUBLIC
Expand All @@ -27,15 +35,12 @@ target_include_directories(${PROJECT_NAME} PUBLIC

target_link_libraries(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/lib/fmt.lib
${CMAKE_CURRENT_SOURCE_DIR}/lib/libMinHook.x6.lib
)


# EnTT Compile options
target_compile_definitions(${PROJECT_NAME} PUBLIC ENTT_PACKED_PAGE=128)

# Set the ASM sources for the library
set_property(TARGET ${PROJECT_NAME} PROPERTY ASM_SOURCES ${ASM})

# Include libhat for SigScan
FetchContent_Declare(
libhat
Expand All @@ -60,13 +65,13 @@ foreach(HEADER ${HEADERS})

endforeach()


# Copy Amethyst's dependencies to AmethystFolder/include
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${AmethystFolder}/include/)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/lib/ DESTINATION ${AmethystFolder}/lib/)


# Create source groups to reflect the directory structure in Visual Studio
foreach(_source IN ITEMS ${SOURCES} ${HEADERS} ${ASM})
foreach(_source IN ITEMS ${SOURCES} ${HEADERS})
get_filename_component(_source_path "${_source}" PATH)
file(RELATIVE_PATH _source_path_rel "${CMAKE_CURRENT_SOURCE_DIR}/src" "${_source_path}")
string(REPLACE "/" "\\" _group_path "${_source_path_rel}")
Expand Down
183 changes: 0 additions & 183 deletions AmethystAPI/include/MinHook.h

This file was deleted.

Binary file removed AmethystAPI/lib/libMinHook.x64.lib
Binary file not shown.
Loading

0 comments on commit 86083c8

Please sign in to comment.