Compare commits

...

4 Commits

Author SHA1 Message Date
James Rowe
55c3ec60a7 Build: Undef weird mingw macros for precompiled header support 2018-08-22 18:42:01 -06:00
James Rowe
d350f59864 Build: Change automoc policy to include generated files 2018-08-22 18:42:01 -06:00
James Rowe
e5dcf49e6a Build: Fix Precompiled headers including cmath missing macros 2018-08-22 18:42:01 -06:00
James Rowe
87f18dce7a Build: Add cotire for precompiled header
Explicitly turns off cotire unity build support
2018-08-22 18:41:34 -06:00
11 changed files with 4253 additions and 1 deletions

4190
CMakeModules/cotire.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
add_library(audio_core STATIC
algorithm/filter.cpp
algorithm/filter.h
@@ -24,8 +27,12 @@ add_library(audio_core STATIC
create_target_directory_groups(audio_core)
target_link_libraries(audio_core PUBLIC common core)
target_compile_definitions(audio_core PRIVATE -D_USE_MATH_DEFINES)
if(ENABLE_CUBEB)
target_link_libraries(audio_core PRIVATE cubeb)
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
endif()
set_target_properties(audio_core PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(audio_core)

View File

@@ -1,3 +1,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
# Generate cpp with Git revision from template
# Also if this is a CI build, add the build name (ie: Nightly, Bleeding Edge) to the scm_rev file as well
set(REPO_NAME "")
@@ -90,3 +93,6 @@ target_link_libraries(common PUBLIC Boost::boost fmt microprofile)
if (ARCHITECTURE_x86_64)
target_link_libraries(common PRIVATE xbyak)
endif()
set_target_properties(common PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(common)

View File

@@ -1,3 +1,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
add_library(core STATIC
arm/arm_interface.h
arm/exclusive_monitor.cpp
@@ -383,3 +386,6 @@ if (ARCHITECTURE_x86_64)
)
target_link_libraries(core PRIVATE dynarmic)
endif()
set_target_properties(core PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(core)

View File

@@ -17,6 +17,15 @@ enum {
};
}
// When using mingw precompiled headers, it pulls in some dark corners of the stdlib that defines
// these as macros
#ifdef ERROR_PATH_NOT_FOUND
#undef ERROR_PATH_NOT_FOUND
#endif
#ifdef ERROR_FILE_NOT_FOUND
#undef ERROR_FILE_NOT_FOUND
#endif
constexpr ResultCode ERROR_PATH_NOT_FOUND(ErrorModule::FS, ErrCodes::NotFound);
// TODO(bunnei): Replace these with correct errors for Switch OS

View File

@@ -13,6 +13,12 @@
#include "core/hle/service/time/interface.h"
#include "core/hle/service/time/time.h"
// When using mingw precompiled headers, it pulls in some dark corners of the stdlib that defines
// GetCurrentTime as a macro
#ifdef GetCurrentTime
#undef GetCurrentTime
#endif
namespace Service::Time {
class ISystemClock final : public ServiceFramework<ISystemClock> {

View File

@@ -12,6 +12,11 @@
namespace Loader {
// When using mingw precompiled headers, it pulls in some dark corners of the stdlib that defines
// RELATIVE as a macro
#ifdef RELATIVE
#undef RELATIVE
#endif
enum class RelocationType : u32 { ABS64 = 257, GLOB_DAT = 1025, JUMP_SLOT = 1026, RELATIVE = 1027 };
enum DynamicType : u32 {

View File

@@ -1,3 +1,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
add_library(input_common STATIC
analog_from_button.cpp
analog_from_button.h
@@ -19,3 +22,6 @@ if(SDL2_FOUND)
target_link_libraries(input_common PRIVATE SDL2)
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
endif()
set_target_properties(input_common PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(input_common)

View File

@@ -1,3 +1,6 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
add_library(video_core STATIC
command_processor.cpp
command_processor.h
@@ -55,3 +58,6 @@ create_target_directory_groups(video_core)
target_link_libraries(video_core PUBLIC common core)
target_link_libraries(video_core PRIVATE glad)
set_target_properties(video_core PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(video_core)

View File

@@ -1,7 +1,11 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
cmake_policy(SET CMP0071 NEW)
add_executable(yuzu
Info.plist
@@ -105,6 +109,9 @@ target_link_libraries(yuzu PRIVATE common core input_common video_core)
target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets)
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
set_target_properties(yuzu PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(yuzu)
if(UNIX AND NOT APPLE)
install(TARGETS yuzu RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()

View File

@@ -1,4 +1,5 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
include(cotire)
add_executable(yuzu-cmd
config.cpp
@@ -20,6 +21,9 @@ if (MSVC)
endif()
target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} SDL2 Threads::Threads)
set_target_properties(yuzu-cmd PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(yuzu-cmd)
if(UNIX AND NOT APPLE)
install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()