Fix some compiling problems on OSX

and enable osx builds on travis
This commit is contained in:
Danila Malyutin 2015-08-17 18:14:29 +03:00 committed by Nekotekina
parent e8088d1216
commit 009370f73c
6 changed files with 79 additions and 38 deletions

View File

@ -1,5 +1,11 @@
language: cpp language: cpp
os:
- linux
- osx
osx_image: xcode6.4
compiler: compiler:
- clang - clang
- gcc - gcc
@ -12,47 +18,58 @@ branches:
except: except:
- ppu_recompiler - ppu_recompiler
matrix:
exclude:
- os: osx
compiler: gcc
git: git:
submodules: false submodules: false
before_install: before_install:
# shutdown services on Travis, which may have a memory impact # shutdown services on Travis, which may have a memory impact
# show memory usage before and after shutdown of services # show memory usage before and after shutdown of services
- sudo service --status-all - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
- sudo free -m -t sudo service --status-all;
- sudo /etc/init.d/mysql stop sudo free -m -t;
- sudo /etc/init.d/postgresql stop sudo /etc/init.d/mysql stop;
- sudo /etc/init.d/couchdb stop sudo /etc/init.d/postgresql stop;
- sudo /etc/init.d/redis-server stop sudo /etc/init.d/couchdb stop;
- sudo free -m -t sudo /etc/init.d/redis-server stop;
sudo free -m -t;
fi;
- echo "yes" | sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
- echo "yes" | sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe' echo "yes" | sudo apt-key adv --fetch-keys 'http://repos.codelite.org/CodeLite.asc';
# Add later version of Clang, apt from llvm.org. the repository link is for development version. echo "yes" | sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe';
- echo "yes" | sudo add-apt-repository 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main' echo "yes" | sudo add-apt-repository 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main';
- echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main' echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main';
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -; wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -;
# And the libstdc++4.9 of GCC from ppa sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y;
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt-get update;
- sudo apt-get update sudo apt-get install libwxgtk3.0-dev libopenal-dev freeglut3-dev libglew-dev libc6-dev llvm-3.6 llvm-3.6-dev libedit-dev;
- sudo apt-get install libwxgtk3.0-dev libopenal-dev freeglut3-dev libglew-dev libc6-dev llvm-3.6 llvm-3.6-dev libedit-dev sudo apt-get install aria2 -qq;
- sudo apt-get install aria2 -qq download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; };
- download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; } fi;
- if [ "$CXX" = "g++" ]; then - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "g++" ]; then
sudo apt-get install -qq g++-4.9; sudo apt-get install -qq g++-4.9;
export CXX="g++-4.9" CC="gcc-4.9" CXXFLAGS="-Wno-format-security"; export CXX="g++-4.9" CC="gcc-4.9" CXXFLAGS="-Wno-format-security";
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'; export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01';
else elif [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq --allow-unauthenticated clang-3.6 libstdc++-4.8-dev; sudo apt-get install -qq --allow-unauthenticated clang-3.6 libstdc++-4.8-dev;
export CXX="clang++-3.6" CC="clang-3.6"; export CXX="clang++-3.6" CC="clang-3.6";
fi; fi;
# Travis uses CMake 2.8.7. We require 2.8.8. Grab latest # Travis uses CMake 2.8.7. We require 2.8.8. Grab latest
- sudo apt-get install lib32stdc++6 -qq &&
aria2c -x 16 http://www.cmake.org/files/v3.0/cmake-3.0.0-Linux-i386.sh &&
chmod a+x cmake-3.0.0-Linux-i386.sh &&
sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr;
# Add coverall for C++ so coverall.io could be triggered. Even it should be --coverage and gcov. # Add coverall for C++ so coverall.io could be triggered. Even it should be --coverage and gcov.
- sudo pip install cpp-coveralls - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install lib32stdc++6 -qq &&
aria2c -x 16 http://www.cmake.org/files/v3.0/cmake-3.0.0-Linux-i386.sh &&
chmod a+x cmake-3.0.0-Linux-i386.sh &&
sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr;
sudo pip install cpp-coveralls;
else
brew install glew wxwidgets;
fi;
before_script: before_script:
- git submodule update --init asmjit ffmpeg llvm - git submodule update --init asmjit ffmpeg llvm
@ -82,7 +99,8 @@ script:
after_success: after_success:
- if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then coveralls --extension .c --extension .cpp --extension .h; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ]; then coveralls --extension .c --extension .cpp --extension .h; fi
after_failure: after_failure:
# show memory usage again # show memory usage again and show actions of the OOM killer
- sudo free -m -t - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# show actions of the OOM killer sudo free -m -t;
- sudo dmesg sudo dmesg;
fi;

View File

@ -1,5 +1,11 @@
#pragma once #pragma once
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <x86intrin.h>
#endif
#define IS_LE_MACHINE // only draft #define IS_LE_MACHINE // only draft
union u128 union u128

View File

@ -1234,7 +1234,7 @@ thread_t::thread_t(std::function<std::string()> name, std::function<void()> func
start(std::move(name), func); start(std::move(name), func);
} }
thread_t::~thread_t() noexcept(false) thread_t::~thread_t() //noexcept(false)
{ {
if (m_thread) if (m_thread)
{ {

View File

@ -49,7 +49,7 @@ public:
thread_t(std::function<std::string()> name, std::function<void()> func); thread_t(std::function<std::string()> name, std::function<void()> func);
// destructor, joins automatically (questionable, don't rely on this functionality in derived destructors) // destructor, joins automatically (questionable, don't rely on this functionality in derived destructors)
virtual ~thread_t() noexcept(false); virtual ~thread_t() /*noexcept(false) compile error on osx*/;
thread_t(const thread_t&) = delete; thread_t(const thread_t&) = delete;

View File

@ -5,7 +5,7 @@ configuration:
- ReleaseLLVM - ReleaseLLVM
platform: x64 platform: x64
clone_folder: c:\rpcs3 clone_folder: c:\rpcs3
clone_depth: 1 clone_depth: 3
test: off test: off
branches: branches:

View File

@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
set(CMAKE_VERBOSE_MAKEFILE ON)
include(cotire) include(cotire)
project(rpcs3) project(rpcs3)
@ -18,8 +19,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif() endif()
# Warnings # Warnings
add_compile_options(-Wno-attributes -Wno-enum-compare -Wno-invalid-offsetof) add_compile_options(-Wno-attributes -Wno-enum-compare -Wno-invalid-offsetof)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# TODO: stdlib? if(APPLE)
add_compile_options(-stdlib=libc++) # TODO: stdlib?
endif()
endif() endif()
if(NOT MSVC) if(NOT MSVC)
@ -59,13 +62,26 @@ EndIf()
set(CMAKE_MODULE_PATH "${RPCS3_SRC_DIR}/cmake_modules") set(CMAKE_MODULE_PATH "${RPCS3_SRC_DIR}/cmake_modules")
if(NOT WIN32) if(NOT WIN32)
add_definitions(-DGL_GLEXT_PROTOTYPES) add_definitions(-DGL_GLEXT_PROTOTYPES)
add_definitions(-DGLX_GLXEXT_PROTOTYPES) add_definitions(-DGLX_GLXEXT_PROTOTYPES)
endif() endif()
find_package(wxWidgets COMPONENTS core base net aui gl xml REQUIRED) find_package(wxWidgets COMPONENTS core base net aui gl xml REQUIRED)
if(NOT WIN32) if(NOT WIN32)
find_package(GLEW REQUIRED) if(APPLE)
find_path(GLEW_INCLUDE_DIR GL/glew.h
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/usr/X11R6/include
/usr/include/X11
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglew
/usr/local/include
)
endif()
find_package(GLEW REQUIRED)
message("${GLEW_LIBRARY} AND ${GLEW_INCLUDE_DIR}")
endif() endif()
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(OpenAL REQUIRED) find_package(OpenAL REQUIRED)
@ -82,6 +98,7 @@ else()
endif() endif()
include_directories( include_directories(
${GLEW_INCLUDE_DIR}
${wxWidgets_INCLUDE_DIRS} ${wxWidgets_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}
${LLVM_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS}