* GTK3_API requires a wxWidget that support it too
=> avoid complexe compilation error
* SDL2_API requires a wxWidget without SDL support (wxUSE_LIBSDL = 0)
=> avoid run time crash
SDL check hypothesis: wx is linked against SDL1.2 and not SDL2. It would need to be improved on a distant future
This fixes it for build.sh and when not using build.sh (packaging).
.
Also fix native 32bit build which should also be broken and attempt to
predict the future and fix it for lib32-wx3.0. Worst case the filenames
have to be fixed which is trivial.
.
When wx2.8 support is dropped then only the lib32-wx3.0 IF should remain.
When crosscompilation support gets dropped then the first IF gets deleted
unless we also dropped wx2.8 support then everything gets deleted.
I only had to add "PATH_SUFFIXES SDL2".
.
include is superfluous
SDL2-2.0 is a distro specific convenience symlink. Use the correct one
as before.
.
I probably did this as an artificial way of disabling pkgconfig when cross
compiling and before disabling pkgconfig for all cross compiling but it's
wrong. I thought I had fixed this already.
User may forget or not know about -DUSE_CLANG=TRUE. It could probably
be always autodetected instead of requiring user input.
.
Trivial wording changes to compiler_version.
Tell the user to use CMAKE_TOOLCHAIN_FILE upon failure.
.
Cleanup detectOperatingSystem. Should be the same but adding
GNU and kFreeBSD from Debian and filtering out pre OS X Apple.
.
libaio is linux only. Also check for the correct header since
aio.h is the POSIX one. Both are in /usr/include/ anyway.
Only build core if (Linux AND NOT AIO_FOUND) == false.
.
Use Unix for GTK and X11. Macs has gtk-quartzs and xquartz or native X11.
*BSD, linux, etc should have both.
Even before this pull request it was required to set PKG_CONFIG_PATH
when cross compiling since pkg-config always searches for native
libraries. This would require to backup an already existing ENV
variable if present, detect the distro specific place the pkgconfig folder is,
and restore the original ENV variable if it was present. Cmake as shown in:
.
http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3df51470
.
added support for this but requires CMAKE_MINIMUM_REQUIRED_VERSION as 3.1
which is kind of strict since it was released 10 days ago.
.
To avoid the ugliness let just avoid pkg-config when cross compiling. This
means only EGL, SDL2 and GTK3 have to be updated since the rest work w/o
pkg-config.
- EGL is fixed with PR #409
- SDL2 is fixed here and it's trivial.
- GTK3 is non-trivial. For this one use pkg-config for native builds since
the .pc file is kept up to date automatically. For cross compilation
use the provided FindGTK3 which I made by using the sed documented
inside the file and updating the dependencies for GTK3. Since I checked
each and every single .pc file to make sure they are up to date this
should have the same behaviour as pkg-config. Prefer the .pc files for
native builds since it does not need to be manually updated and when
the native 64bit port gets finished all the cross compile options should
be removed which is quite easy since most of the code got moved to the
CMAKE_TOOLCHAIN_FILE.
Note:
Cmake Modules are BSD-3-clause therefore GPL compatible.
The obtained binaries before and after this commit are identical (sha1sum)
when compiled in Debian/Ubuntu/Fedora/ArchLinux.
.
The linker will always pick the 32bit libraries the only thing this does is
make sure we have all the 32bit dependencies installed. Basically we avoid
detecting the 64bit libraries and telling the users the 32bit libraries were
found. We always link with 32bit libraries therefore this avoids having to
wait 5-10min to just be told -lXXX is missing.
.
The only thing really needed are
set(CMAKE_LIBRARY_ARCHITECTURE "../lib32")
set(CMAKE_LIBRARY_ARCHITECTURE ".")
.
which basically ensures we don't pick 64bit headers since
CMAKE_LIBRARY_ARCHITECTURE always gets tested first and for some reason
FindGTK2 test searches lib64 first then lib32/lib. These values are hardcoded.
Right now these arch specific headers are not used but can't say this will
always be true.
.
FIND_LIBRARY_USE_LIB64_PATHS is not needed for native builds and it's covered
by CMAKE_SYSTEM_IGNORE_PATH.
.
NOTE:
We filter out lib32 because multilib is not compatible with multiarch.
- Fedora only needs --arch if cross compiling.
+ It's only used to select libdir so i386=i686=i986
- Messages are nice to debug build logs.
.
Everything seems to work unless some other distro broke. Other
distros need to add CMAKE_TOOLCHAIN_FILE or --cross-multilib if
they cross compiled amd64 -> i686.
- Update the build.sh and fix some typos.
+ Don't add the OSX ones because I have not tested them and it won't
even build anyway due to the libaio dependency. Needs to use POSIX AIO
or something else.
- They are rather simple and all the magic happens in two lines.
+ First line tells cmake to get ready to compile FOR linux or darwin.
It also sets CMAKE_CROSSCOMPILING to true which is the only way to
let cmake known that we are using stuff not from the host.
+ CMAKE_C_COMPILER/CMAKE_CXX_COMPILER are basically used to detect
the architecture of the target. Since I used generic cc/c++ the
hardcoded -m32 is needed to ensure we get TARGET=i386. Also
since I hardcode -m32 and use c++/cc it's to be noted that
we can only do i386->i386 (trivial), amd64 -> i386, and x32->i386.
.
Using something like i586-linux-gnu-{gcc,g++} would also work and
enable arm -> i386, etc but it's infeasible and impractical to do all
the combinations. File is simple enough that a distro or user can
create their own and cross compiling is rather tedious compared
to using a chroot to compile it.
- I tested it in Debian with "dpkg-buildpackage -ai386" but installing the
build dependencies was rather tedious.
http://www.vtk.org/Wiki/CMake_Cross_Compilinghttp://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html
.
The official way that cmake does cross compiling is via the use of a
CMAKE_TOOLCHAIN_FILE. This has to be given by the user and can't be
included from within a Cmake file since setting up the toolchain has
to be the first thing that happens.
.
After the file is given and validated cmake behaves nicely and all the
workarounds and hacks are not really needed anymore.
.
The consequence of this change is that without this file cmake will
try to build for the HOST architecture as expected and with the file
it will build for the TARGET architecture of the given toolchain. Due to
this remove 64BIT_BUILD_DONT_WORK and just ERROR out if the user tries
in the same way as before.
Currently crosscompiling was broken since we detected the cpu of the host
not of the target. Building arm -> i386, i386->amd64, etc resulted in
interesting stuff.
.
CMAKE_HOST_SYSTEM_PROCESSOR and CMAKE_SYSTEM_PROCESSOR should have done this
but they are incredibly broken and unreliable. I use
CMAKE_HOST_SYSTEM_PROCESSOR just to retain the format of the old message
and is not used for critical stuff so it does not matter.
.
This code also allows scalability so that if one day in the very distant
and unlikely future the x86/x86_64 specific code gets made portable
by replacing asm/MMX/SSE*/AVX/etc code with generic/portable code then
it also would work on all architectures.
.
For *BSD/OS X it probably would need to use POSIX AIO instead of linux
specific libaio but that is a different issue.
.
Error out the x86_64 builds.
Also the 64BIT_BUILD_DONT_WORK option became obsolete more info in following
commit.
- Update copyright due to incoming changes.
- Don't support universal binaries until they actually work therefore
only allow 1 architecture in CMAKE_OSX_ARCHITECTURES.
- Don't allow an empty ARCH list.
We probably asked for ppc or ppc64 w/o support for it.
For now just dump the original and add the BSD-2-Clause.
.
It's GPL compatible so it's okay.
.
I was writting one myself but found this one and it handles apple
which I did not consider since I can't test it.
EGL sometimes is not found. Checklib 1st does
.
string(TOLOWER ${lib} lower_lib)
pkg_search_module(${var} QUIET ${lower_lib})
.
Therefore this part should be equivalent since we always compare lower.
.
This part seems to not find anything and then it does.
.
find_library(${var}_LIBRARIES ${lib})
.
Here it also does not find anything since it tries to find libegl
while the library is called libEGL therefore I changed the name to upper.
to avoid
_internal_message("-- ${lib} not found (miss lib)")
.
It could fail in the unlikely event that someone renamed libEGL to libegl.
This bug is triggered when you combine crosscompiling from amd64 to
i386 with Debian multiarch paths. For other distros it should work with
pkg_search_module normally.
Namely GTK3_API and 64BIT_BUILD_DONT_WORK
The former was barely tested and doesn't compile with standard wx
The latter doesn't work at all
Note: I was very close to disable SDL2 too. If wxWidget was built with
SDL1 support it will crash
Description: Building with SDL2_API=TRUE is incomplete
SDL_FOUND does not imply SDL2_FOUND
Use check_libs for detection
Only include ${SDL_INCLUDE_DIR} when needed
Use SDL2_LIBRARIES
Author: Miguel A. Colón Vélez
Gregory: add back SDL_BUILDING_LIBRARY
+ Wx3.0 fixes various issue on linux (better sizing of box)
+ Debian doesn't provide wx2.8 anymore. Ubuntu will probably follow soon (close issue #342)
If you want to use wx2.8:
* Either you remove wx3.0 from your system
* Either you use the cmake option -DWX28_API=TRUE
Please don't hesitate to report any regresions.
I need to check carefully the consequence of ABI change. So far wx is very unhappy!
Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1006,wx containers,compatible with 2.6).
* link common with c lib (required for gold linker)
* fix the macro to properly set the library variable
=> use the variable instead to hardcoded value
Fixes RPMLINT warning:
pcsx2.i586: W: file-contains-date-and-time /usr/bin/pcsx2
Your file uses __DATE and __TIME__ this causes the package to rebuild when not needed
* disable unused value warning (don't like the syntax 0&&)
* remove -Wno-ignored-attributes (c option). It replaces gcc warning
by an unsupported option warning...
GCC doesn't support pentium4 as a arch target for x86_64. It complains that the architecture doesn't support x86_64
Which to be fair the first few models didn't support 64bit.
Just remove the architecture setting since there isn't a need for it.
Move build configuration from CMakeLists to cmake/BuildParameters.cmake where it belongs
Use option syntax for on/off option
Complete a bit previous commit to force all 64bits path detections (likely done by cmake)
By default the cmake build will still cross compile a 32bit binary and spout a message about it if not enabled.
This doesn't fix the 64bit build issues, just makes it easier for someone to test 64bit builds in the future.
Look towards a bright future instead of a dark and gloomy past
* avoid compilation failure when git -C isn't supported
* don't print missing dependency when EXTRA_PLUGINS isn't activated
* sed /endif(.*)/endif/ because I don't like it
--extra for ./build.sh script
By default only build the pricipal plugin: GSdx|zzogl/spu2-x/onepad/UsbNull/Dev9Null
Extra plugins are: GsNull|zzogl-cg/Spu2Null|zerospu/PadNull
The purpose is to improve compilation time on linux
cmake: don't strip by default the binary in release mode
gsdx: disable the regeneration of ogl shader
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5806 96395faa-99c1-11dd-bbfe-3dabce05a288
* new option SDL2_API
* drop GLSL_SHADER_DIR. Useless, shaders are embedded in .h file
* use some hardening flags (for the moment only basic one)
onepad:
* port the code to SDL2 (Note only SDL1 is supported for the moment)
* improve detection of button vs axis (long-standing issue)
* avoid potential overflow on mouse mouvement detection
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5756 96395faa-99c1-11dd-bbfe-3dabce05a288
* use gles header file, disable opengl code (mainly GLX, ARB_sso, geometry shader)
* Define properly the function pointer, GLES use basic linking whereas GL must get the symbol dynamically
* cmake: properly search and set libglesv2.so
* don't use dual source blending => HW renderer work (only miss unimportant FBA)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5701 96395faa-99c1-11dd-bbfe-3dabce05a288
* uniform was wrongly set before the activation of the program (free driver only)
* Always use only 1 drawbuffer. Easier besides previous setup was wrong for convert:ps_main1
GLES trial (v3):
* add the cmake option GLES_API. Note library (libgles) are hardcoded for the moment
* Disable opengl check
* Disable gl_GetDebugMessageLogARB not supported!
* Emulate gl_DrawElementsBaseVertex, add manually the index offset (surely slow but work)
* Fix hundred of shader error (no implicit cast of integer to float...)
Unfortunately GLES doesn't support dual blending so no blend in hardware renderer. Otherwise it is fine
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5700 96395faa-99c1-11dd-bbfe-3dabce05a288
* try to setup advance gl context attribute. If driver doesn't support it fallback to the default.
zzogl:
* use glsl2h to generate an header shader as GSdx. Much easier to install
* Get GSUniformBufferOGL & GSVertexArrayOGL speed improvement from GSdx
cmake:
* detect current gcc version. Yield a warning if < 4.7 or an error if < 4.5
glsl2h:
* support zzogl too
* compute md5sum to avoid useless relink
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5696 96395faa-99c1-11dd-bbfe-3dabce05a288
* various cast was overflowing
- use unsigned integer for SSE mask
- force SINGLE macro to use u32
* disable parenthesis warning, only a matter of coding style
Remains 2 wrong use of unsigned integer:
pcsx2/CDVD/InputIsoFile.cpp:96:21: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
pcsx2/Memory.cpp:108:86: warning: narrowing conversion of ‘-1’ from ‘int’ to ‘vtlbHandler {aka unsigned int}’ inside { } is ill-formed in C++11 [-Wnarrowing]
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5689 96395faa-99c1-11dd-bbfe-3dabce05a288
* use svnrev.h on linux too
* replace sprintf_s with snprintf (hope it still compile on Windows)
* init integer with 0 instead of NULL
* various int -> u32/uint32/uint on for loop index
* remove a couple of unused variable
* init few variable
* disable unused warning results
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5683 96395faa-99c1-11dd-bbfe-3dabce05a288
gsdx:
* move gl function loading into GSwnd. Clean the header and avoid to rely on macro.
* Always require libegl for GSdx. You still need to select the API at compilation.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5670 96395faa-99c1-11dd-bbfe-3dabce05a288
* fix a bad interaction when GL_ARB_SSO is supported without GL_ARB_shading_language_420pack
* try to replace struct with flat parameter in glsl interface
=> with some hacks of the free driver, I was able to compile SW renderer shader. Unfortunately
the rendering is broken. Maybe my hack :p
* remove EGL context check (wasn't working as expected)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5644 96395faa-99c1-11dd-bbfe-3dabce05a288
* Try to launch dev/debug version when pcsx2 isn't found
* remove svn metadata from the linux tarball
* Add libaio on the cmake dependency message
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5624 96395faa-99c1-11dd-bbfe-3dabce05a288
* move all remaining glx into the dedicated GLwin object
* rework a bit WGL to separate opengl context and window creation (like linux actually)
gsdx: Allow to control vsync. Not sure I used the good extension.
cmake:
* check that EGL opengl context creation
* Shut up gcc warning when force inline might not work...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5437 96395faa-99c1-11dd-bbfe-3dabce05a288
* EGL is the interface between the window and opengl. The purpose is to replace GLX/WGL in a crossplatform way.
Unfortunately so far only opensource driver use it (need not yet released mesa 9.0)
* clean most of the legacy GSopen1 window management. Only keep a basic window for debug with replayer.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5422 96395faa-99c1-11dd-bbfe-3dabce05a288
cmake: take the opportunity to drop the support of 3rdparty compilation. Distributions have got a more recent version of zlib/soundtouch anyway.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5376 96395faa-99c1-11dd-bbfe-3dabce05a288
glsl4: Replace some define with function (ogl4 support function pointer). Explain how depth is computed in vertex shader
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5233 96395faa-99c1-11dd-bbfe-3dabce05a288
various: apply some patch of Micove to disable debug logging in GSdx release mode
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5206 96395faa-99c1-11dd-bbfe-3dabce05a288
* drop hack for of Natty and use the std FindGtk2 module, time to upgrade to Precise.
* Bump cmake requirement to 2.8.5 to avoid multiarch issue
* Create new cmake variable GLSL_SHADER_DIR for glsl file. Default value /usr/share/games/pcsx2
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5200 96395faa-99c1-11dd-bbfe-3dabce05a288
* Add 2 new dev options: REBUILD_SHADER (nvidia cg) & BUILD_REPLAY_LOADERS
* zzogl-pg-cg will use the shader of zzogl-pg.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5190 96395faa-99c1-11dd-bbfe-3dabce05a288
* for the moment only the SW render is supported, hopefully HW will come some day. And linux only for the moment.
* Require an OpenGL3 GPU (==Dx10) ie Nvidia >= 8800, AMD >= HD2000)
* Require an OpenGL4.2 compatible drivers => no opensource driver supported neither Intel driver.
* Build by default without SDL support which will dropped later. You need to add this define "ENABLE_SDL_DEV" on Win.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5186 96395faa-99c1-11dd-bbfe-3dabce05a288
* new memory management
* asm was replaced by intrinsic
* new GLSL backend (AMD only) Cmake is probably broken anyway with the 2 plugins...
* and lots of others stuff that I forgot about it ;)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5166 96395faa-99c1-11dd-bbfe-3dabce05a288
* update missing copyright on
+ plugins/GSdx/config.h
+ pcsx2/MTVU.h
+ plugins/zzogl-pg/opengl/ZZHacks.h
+ plugins/spu2-x/src/DplIIdecoder.cpp
* put a copyright for trivial script file
+ pcsx2/gui/Resources/rebuild.sh
+ tools/bin2app.sh
+ plugins/zzogl-pg/opengl/shaders.sh
* remove autotool from zzogl
* apply the patch for issue 1257. Thanks very much Micove for the hard work.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5154 96395faa-99c1-11dd-bbfe-3dabce05a288
* add some define to enable/disable SDL so we could build gsdx without SDL
* debug: dump data based on frame count rather from draw count
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@5044 96395faa-99c1-11dd-bbfe-3dabce05a288
cmake: implement the new XDG_STD options
It allow to move all pcsx2 data from $HOME/PCSX2 to $XDG_CONFIG_DIR/pcsx2. Clearly a matter of personnal preference.
debian: drop the useless stable packet from the trunk. Only keep a copy on branch release
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5001 96395faa-99c1-11dd-bbfe-3dabce05a288
* implement the saving of texture (take bmp SW code)
* fix the missing "enable attribute code" and the typo in glsl. It works now !!!
* rework a little texture to pack texture into a temporay buffer when src pitch != dst pitch
* try to replace sdl with pure xlib (not yet enabled by default but it seems to work)
Note there still a minor issue, coordinate are different between DX and OGL (upper-left vs lower-left) so the image is inversed.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4981 96395faa-99c1-11dd-bbfe-3dabce05a288
* new dev option CMAKE_BUILD_PO: control regeneration of po file. By default true in release build
* Add a hack for multiarch version of wxwidget
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4951 96395faa-99c1-11dd-bbfe-3dabce05a288
* use the standard 3 step flow: cmake, make, make install
* Remove L10N_PORTABLE option, superseeded by PACKAGE_MODE
* Extend PACKAGE_MODE to select the install directory (FHS or local bin)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4805 96395faa-99c1-11dd-bbfe-3dabce05a288
cmake:
* disable fomit-frame-pointer which cause crash with gcc-4.6 (it was not enabled by default but now I'm sure people will not enable it ;) )
* Try harder to pick the 32bits configuration for wx in a 64bits environment (opensuse/fedora).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4641 96395faa-99c1-11dd-bbfe-3dabce05a288
The option is on by default.
Note: pcsx2 does not detect yet mo file on linux.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4245 96395faa-99c1-11dd-bbfe-3dabce05a288
Note: to install them, you must call "make install" with root access. Files will be install into /usr/local/share/locales...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4238 96395faa-99c1-11dd-bbfe-3dabce05a288
* move content of version.h into CDVDlinuz.h (avoid a conflict with version.h located in /usr/include/alsa)
* allow cmake to build it.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3654 96395faa-99c1-11dd-bbfe-3dabce05a288
* move machine optimization in the global setup. In same time use i686 instead of i486
* Also build the debug with fvisibility=hidden No reason to use it only on devel. (actually same as codeblock)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3628 96395faa-99c1-11dd-bbfe-3dabce05a288
Note: last gtk version moves the gdk-pixbuf module into another place.
Technically cmake needs an update of the FINDGTK2 module. For the moment I add a small work-around.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3589 96395faa-99c1-11dd-bbfe-3dabce05a288
* Major rework of the linker flags. Use some globals flags for -s and -m32
Add a USER_CMAKE_LD_FLAGS variable. Easier to play with advanced link flags for future gcc version (>=4.5)
* Remove useless stub file
[debian]
* minor dependency fix
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3475 96395faa-99c1-11dd-bbfe-3dabce05a288
For example enable more optimization on c++:
cmake CMakeLists.txt DUSER_CMAKE_CXX_FLAGS="-O3"
Or more warning on c++:
cmake CMakeLists.txt DUSER_CMAKE_CXX_FLAGS="-Wstrict-aliasing"
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3417 96395faa-99c1-11dd-bbfe-3dabce05a288