Merge pull request #1714 from smspillaz/fix-1711

Fixes for #1711 and other compilation errors.
This commit is contained in:
bunnei 2016-04-25 09:08:25 -04:00
commit 28de7f584e
6 changed files with 15 additions and 10 deletions

View file

@ -9,7 +9,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
export CXX=g++-5 export CXX=g++-5
mkdir -p $HOME/.local mkdir -p $HOME/.local
curl -L http://www.cmake.org/files/v2.8/cmake-2.8.11-Linux-i386.tar.gz \ curl -L http://www.cmake.org/files/v3.1/cmake-3.1.0-Linux-i386.tar.gz \
| tar -xz -C $HOME/.local --strip-components=1 | tar -xz -C $HOME/.local --strip-components=1
( (
@ -20,6 +20,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
) )
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew update > /dev/null # silence the very verbose output brew update > /dev/null # silence the very verbose output
brew install qt5 sdl2 dylibbundler brew unlink cmake
brew install cmake31 qt5 sdl2 dylibbundler
gem install xcpretty gem install xcpretty
fi fi

View file

@ -1,6 +1,6 @@
# CMake 2.8.11 required for Qt5 settings to be applied automatically on # CMake 3.1 required for Qt5 settings to be applied automatically on
# dependent libraries. # dependent libraries and IMPORTED targets.
cmake_minimum_required(VERSION 2.8.11) cmake_minimum_required(VERSION 3.1)
function(download_bundled_external remote_path lib_name prefix_var) function(download_bundled_external remote_path lib_name prefix_var)
set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
@ -135,6 +135,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
# Prefer the -pthread flag on Linux.
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
if (ENABLE_SDL2) if (ENABLE_SDL2)

View file

@ -21,7 +21,7 @@ target_link_libraries(citra ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad)
if (MSVC) if (MSVC)
target_link_libraries(citra getopt) target_link_libraries(citra getopt)
endif() endif()
target_link_libraries(citra ${PLATFORM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(citra ${PLATFORM_LIBRARIES} Threads::Threads)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD")
install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View file

@ -39,7 +39,7 @@ static void assert_noinline_call(const Fn& fn) {
}); } while (0) }); } while (0)
#define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!") #define UNREACHABLE() ASSERT_MSG(false, "Unreachable code!")
#define UNREACHABLE_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) #define UNREACHABLE_MSG(...) ASSERT_MSG(false, __VA_ARGS__)
#ifdef _DEBUG #ifdef _DEBUG
#define DEBUG_ASSERT(_a_) ASSERT(_a_) #define DEBUG_ASSERT(_a_) ASSERT(_a_)

View file

@ -43,7 +43,7 @@ void FindContentInfos(Service::Interface* self) {
am_content_count[media_type] = cmd_buff[4]; am_content_count[media_type] = cmd_buff[4];
cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016lx, content_cound=%u, content_ids_pointer=0x%08x, content_info_pointer=0x%08x", LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, content_ids_pointer=0x%08x, content_info_pointer=0x%08x",
media_type, title_id, am_content_count[media_type], content_ids_pointer, content_info_pointer); media_type, title_id, am_content_count[media_type], content_ids_pointer, content_info_pointer);
} }

View file

@ -148,7 +148,7 @@ static Instruction GetVertexShaderInstruction(size_t offset) {
} }
static void LogCritical(const char* msg) { static void LogCritical(const char* msg) {
LOG_CRITICAL(HW_GPU, msg); LOG_CRITICAL(HW_GPU, "%s", msg);
} }
void JitShader::Compile_Assert(bool condition, const char* msg) { void JitShader::Compile_Assert(bool condition, const char* msg) {
@ -795,6 +795,8 @@ void JitShader::FindReturnOffsets() {
case OpCode::Id::CALLU: case OpCode::Id::CALLU:
return_offsets.push_back(instr.flow_control.dest_offset + instr.flow_control.num_instructions); return_offsets.push_back(instr.flow_control.dest_offset + instr.flow_control.num_instructions);
break; break;
default:
break;
} }
} }
@ -854,7 +856,7 @@ void JitShader::Compile() {
uintptr_t size = reinterpret_cast<uintptr_t>(GetCodePtr()) - reinterpret_cast<uintptr_t>(program); uintptr_t size = reinterpret_cast<uintptr_t>(GetCodePtr()) - reinterpret_cast<uintptr_t>(program);
ASSERT_MSG(size <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!"); ASSERT_MSG(size <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!");
LOG_DEBUG(HW_GPU, "Compiled shader size=%d", size); LOG_DEBUG(HW_GPU, "Compiled shader size=%lu", size);
} }
JitShader::JitShader() { JitShader::JitShader() {