diff --git a/CMakeLists.txt b/CMakeLists.txt index f7c07e1d..3949dc8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,4 +18,5 @@ add_subdirectory(${SWA_THIRDPARTY_ROOT}) project("UnleashedRecomp-ALL") # Include sub-projects. +add_subdirectory("UnleashedRecompLib") add_subdirectory("UnleashedRecomp") diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 64abad07..6102f310 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -1,27 +1,13 @@ project("UnleashedRecomp") set(TARGET_NAME "SWA") -file(GLOB "*.cpp") add_compile_definitions(SWA_IMPL) add_compile_definitions(SDL_MAIN_HANDLED) # Microsoft wtf? -add_compile_definitions( - _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR - _HAS_EXCEPTIONS=0) +add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) -add_compile_options( - "/fp:strict" - "/GS-" - "/EHs-c-" - "-march=sandybridge" - "-fno-strict-aliasing") - - -file(GLOB SWA_RECOMPILED_SOURCES "ppc/*.cpp") - -set(SWA_PRECOMPILED_HEADERS - "ppc/ppc_recomp_shared.h" +set(SWA_PRECOMPILED_HEADERS "stdafx.h" ) @@ -67,10 +53,11 @@ set(SWA_CXX_SOURCES ${SWA_HID_CXX_SOURCES} ) -add_executable(UnleashedRecomp ${SWA_RECOMPILED_SOURCES} ${SWA_CXX_SOURCES}) +add_executable(UnleashedRecomp ${SWA_CXX_SOURCES}) set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME}) target_link_libraries(UnleashedRecomp PUBLIC + UnleashedRecompLib PowerUtils o1heap xxHash::xxhash @@ -94,5 +81,3 @@ target_include_directories(UnleashedRecomp PRIVATE ) target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS}) - -target_compile_definitions(PowerRecomp PRIVATE CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/ppc/config/SWA.toml\") diff --git a/UnleashedRecomp/cpu/ppc_context.h b/UnleashedRecomp/cpu/ppc_context.h index 888c7983..65a9de89 100644 --- a/UnleashedRecomp/cpu/ppc_context.h +++ b/UnleashedRecomp/cpu/ppc_context.h @@ -1,6 +1,4 @@ #pragma once -#include "ppc/ppc_context.h" -#include "ppc/ppc_recomp_shared.h" inline thread_local PPCContext* gPPCContext; diff --git a/UnleashedRecomp/stdafx.h b/UnleashedRecomp/stdafx.h index 07e5945e..b3bd6def 100644 --- a/UnleashedRecomp/stdafx.h +++ b/UnleashedRecomp/stdafx.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "framework.h" #include "Mutex.h" diff --git a/UnleashedRecompLib/CMakeLists.txt b/UnleashedRecompLib/CMakeLists.txt new file mode 100644 index 00000000..89aebaa7 --- /dev/null +++ b/UnleashedRecompLib/CMakeLists.txt @@ -0,0 +1,14 @@ +project("UnleashedRecompLib") + +add_compile_options( + "/fp:strict" + "-march=sandybridge" + "-fno-strict-aliasing") + +file(GLOB SWA_RECOMPILED_SOURCES "ppc/*.cpp") +add_library(UnleashedRecompLib ${SWA_RECOMPILED_SOURCES}) + +target_include_directories(UnleashedRecompLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_precompile_headers(UnleashedRecompLib PUBLIC ppc/ppc_recomp_shared.h) +target_compile_definitions(PowerRecomp PRIVATE CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\") diff --git a/UnleashedRecomp/ppc/config/SWA.toml b/UnleashedRecompLib/config/SWA.toml similarity index 98% rename from UnleashedRecomp/ppc/config/SWA.toml rename to UnleashedRecompLib/config/SWA.toml index 625d50d0..537a79d8 100644 --- a/UnleashedRecomp/ppc/config/SWA.toml +++ b/UnleashedRecompLib/config/SWA.toml @@ -1,6 +1,6 @@ [main] file_path = "../private/default.xex" -out_directory_path = ".." +out_directory_path = "../ppc" switch_table_file_path = "SWA_switch_tables.toml" skip_lr = true @@ -92,4 +92,4 @@ registers = ["r3"] [[midasm_hook]] name = "SetShadowResolutionMidAsmHook" address = 0x82BAD87C -registers = ["r11"] \ No newline at end of file +registers = ["r11"] diff --git a/UnleashedRecomp/ppc/config/SWA_switch_tables.toml b/UnleashedRecompLib/config/SWA_switch_tables.toml similarity index 100% rename from UnleashedRecomp/ppc/config/SWA_switch_tables.toml rename to UnleashedRecompLib/config/SWA_switch_tables.toml diff --git a/UnleashedRecomp/ppc/.gitignore b/UnleashedRecompLib/ppc/.gitignore similarity index 100% rename from UnleashedRecomp/ppc/.gitignore rename to UnleashedRecompLib/ppc/.gitignore diff --git a/UnleashedRecompLib/private/.gitignore b/UnleashedRecompLib/private/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/UnleashedRecompLib/private/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file