mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Make it build on macOS with Clang
This commit is contained in:
parent
613214cdca
commit
7e1c6a5819
4 changed files with 12 additions and 7 deletions
2
3rdparty/hidapi
vendored
2
3rdparty/hidapi
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit c095a22c53f13ccafc54dc59b5c882cd4036afd9
|
Subproject commit dd0f541d9410364b35c519bf1857c1409a1b7cc0
|
|
@ -90,13 +90,13 @@ extern void jit_finalize()
|
||||||
// Helper class
|
// Helper class
|
||||||
struct MemoryManager : llvm::RTDyldMemoryManager
|
struct MemoryManager : llvm::RTDyldMemoryManager
|
||||||
{
|
{
|
||||||
std::unordered_map<std::string, std::uintptr_t>& m_link;
|
std::unordered_map<std::string, u64>& m_link;
|
||||||
|
|
||||||
std::array<u8, 16>* m_tramps{};
|
std::array<u8, 16>* m_tramps{};
|
||||||
|
|
||||||
u8* m_code_addr{}; // TODO
|
u8* m_code_addr{}; // TODO
|
||||||
|
|
||||||
MemoryManager(std::unordered_map<std::string, std::uintptr_t>& table)
|
MemoryManager(std::unordered_map<std::string, u64>& table)
|
||||||
: m_link(table)
|
: m_link(table)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
jit_compiler::jit_compiler(const std::unordered_map<std::string, std::uintptr_t>& _link, std::string _cpu)
|
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, std::string _cpu)
|
||||||
: m_link(std::move(_link))
|
: m_link(std::move(_link))
|
||||||
, m_cpu(std::move(_cpu))
|
, m_cpu(std::move(_cpu))
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,7 +87,10 @@ endif()
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
||||||
# This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts.
|
# This hides our LLVM from mesa's LLVM, otherwise we get some unresolvable conflicts.
|
||||||
|
if(NOT APPLE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
set(CMAKE_RC_COMPILER_INIT windres)
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
|
@ -331,7 +334,9 @@ if(WIN32)
|
||||||
target_link_libraries(rpcs3 avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib png16_static ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS})
|
target_link_libraries(rpcs3 avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib png16_static ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(rpcs3 ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES})
|
target_link_libraries(rpcs3 ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES})
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(APPLE)
|
||||||
|
target_link_libraries(rpcs3 hidapi-mac "-framework CoreFoundation" "-framework IOKit")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
target_link_libraries(rpcs3 hidapi-hidraw udev vulkan)
|
target_link_libraries(rpcs3 hidapi-hidraw udev vulkan)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(rpcs3 hidapi-libusb usb)
|
target_link_libraries(rpcs3 hidapi-libusb usb)
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct TypeGen<T, std::enable_if_t<std::is_void<T>::value>>
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct TypeGen<T, std::enable_if_t<std::is_same<T, s64>::value || std::is_same<T, u64>::value>>
|
struct TypeGen<T, std::enable_if_t<std::is_same<T, s64>::value || std::is_same<T, u64>::value || std::is_same<T, uptr>::value>>
|
||||||
{
|
{
|
||||||
static llvm::Type* get(llvm::LLVMContext& context) { return llvm::Type::getInt64Ty(context); }
|
static llvm::Type* get(llvm::LLVMContext& context) { return llvm::Type::getInt64Ty(context); }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue