Commit Graph

91 Commits

Author SHA1 Message Date
Miguel A. Colón Vélez ddc9c394a2 Don't use O2 in the Debug Build. 2015-08-08 22:10:40 -04:00
nE0sIghT e1272dc2f9 Use global compiler optimization flags instead of defining them for every plugin/binary 2015-08-08 16:25:17 +03:00
Gregory Hainaut bf7ae3a53e Merge pull request #744 from micove/Cmake_Options
Linux: Add Cmake Options
2015-08-08 09:37:53 +02:00
Gregory Hainaut 99d81868fc cmake: use -ggdb instead of -g
Enable all gdb extensions for debug
2015-08-08 09:16:20 +02:00
Miguel A. Colón Vélez 0d344605e1 Use glibc for strcmp and memcmp.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59048
.
The bug is 5+ years old with no fix in sight.
Mesa did some test that showed 50% improvement and enabled it by default.
http://lists.freedesktop.org/archives/mesa-dev/2011-June/009078.html
.
It could also be coded but glibc version has mmx, sse2, and sse4 support.
2015-08-07 05:04:19 -04:00
Miguel A. Colón Vélez 1db74162e6 Update the gcc version requirements.
It no longer builds with 4.6 and 4.7 since it requires features from 4.8.
Start using c++11 since we no longer support 4.5 & 4.6.
2015-08-07 05:03:37 -04:00
Miguel A. Colón Vélez 8a87981d94 Add options to not install optional files. 2015-08-07 02:39:39 -04:00
Miguel A. Colón Vélez 41cc153bff Only check for the needed dependencies.
Helpful for dropping dependencies package dependencies.
- Git only needed if there is a .git folder
- bzip2 only needed by CDVDiso
- CG/GLEW was for zerogs and ZZogl
- jpeg was for ZZogl
.
I also added that EGL_API is also for GSdx in option comment.
2015-07-27 18:54:04 -04:00
Miguel A. Colón Vélez 83a4b37bcf Add an option to disable the inclusion of the build date.
Debian has a goal to make reproducible builds therefore make it an
option instead of distro specific.
.
I added an "OR openSusE" to not "break" the old openSUSE behavior but ideally
they should just use -DDISABLE_BUILD_DATE=TRUE instead.
.
The old -DopenSUSE is not used for anything else so I removed it.
2015-07-27 14:00:47 -04:00
Gregory Hainaut 8d6d8067fd linux: rename everything. It is PCSX2 is uppercase letter
Sorry for all maintainers that will need to upgrade their packages
2015-05-18 10:04:23 +02:00
Gregory Hainaut 335695bd0e purge GLES from GSdx !
mobile will use vulkan (or any new API) anyway
2015-05-01 20:02:17 +02:00
Gregory Hainaut c5e6013d75 Merge pull request #419 from PCSX2/64-bit-crashes-fix
64 bit crashes fix
2015-01-17 12:08:24 +01:00
Gregory Hainaut b03162747c sVU: add an option to remove it
The goal is to reduce the burden for new architecture port.

Patch is mostly inspired from 3kinox initial patch. The diff are
*/ used ifdef instead of raw removal
*/ gui don't rely on UseMicroVU* option
*/ completely remove sVU_micro.* file
2015-01-06 23:45:43 +01:00
Gregory Hainaut e447ffc8b2 cmake: fix asan on 64 bits 2015-01-05 23:45:37 +01:00
Miguel A. Colón Vélez 8440d263cd Respect the CC and CXX environment variables when cross building. 2015-01-04 00:56:47 -05:00
Miguel A. Colón Vélez e23e2ac327 Rely on clang autodetection instead of user input. 2015-01-03 22:07:16 -05:00
Miguel A. Colón Vélez be1842f4e9 Detect clang and automatically set USE_CLANG.
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.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez c8c22cf6a0 Notify about cross build option upon failure.
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.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez bed7a4f92e Be really strict about dependencies.
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.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez 553536f9cb Fix build in Fedora and print a confimation of cross compilation.
- 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.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez d6d06d243c Begin cleaning up the cross build code.
http://www.vtk.org/Wiki/CMake_Cross_Compiling
http://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.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez 8ea0766773 Use TargetArch to correctly detect the target.
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.
2015-01-03 14:51:04 +01:00
Gregory Hainaut 0c17d67fa5 cmake: add a new option to select the doc path in package mode
DOC_DIR_COMPILATION=/usr/share/doc/pcsx2

close issue #402
2014-12-21 16:51:41 +01:00
Gregory Hainaut dc1cd3eb25 cmake: forbid user to use experimental flags
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
2014-12-21 10:46:33 +01:00
Gregory Hainaut 1f54bb73aa cmake: enable some aggressive warning
Allow to track strict aliasing issue and overflow
2014-12-20 13:43:25 +01:00
Gregory Hainaut 66d7aa75e2 cmake: move -DNDEBUG to global option 2014-12-20 13:43:25 +01:00
Gregory Hainaut 800262fc14 cmake: add a new GTK3.0 option
Thanks #micove for the patch
2014-12-10 22:07:48 +01:00
Gregory Hainaut c945aead54 cmake: better support of SDL2
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
2014-12-07 12:19:14 +01:00
Gregory Hainaut 4b6632edf4 linux: use wx3.0 by default
+ 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.
2014-12-06 19:59:32 +01:00
3kinox 06f53b2689 use -fabi_version=6 only for GSdx, solve bug with wxwidget
reenable avx build for GSdx
2014-11-11 15:55:31 +01:00
Gregory Hainaut ec1da2805c pcsx2/GSdx: disable AVX for the moment on linux
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).
2014-11-09 15:45:54 +01:00
Gregory Hainaut 679fa65b84 cmake: By default optimize for current arch
Note: it requires GCC 4.7. Otherwise use -DDISABLE_ADVANCE_SIMD=OFF to restore
previous behavior. It will impact Ubuntu precise (12.04)
2014-10-26 14:47:35 +01:00
nE0sIghT 7f57692ee3 Use cmake variable "BIN_DIR" for binaries installation 2014-09-27 22:26:42 +04:00
Gregory Hainaut 9c81272278 cmake: oups forget to change the usage of 64BIT_BUILD variable 2014-09-13 14:22:41 +02:00
Gregory Hainaut e101a1d77a linux build: let's be clear that 64 bit is not supported
* rename the cmake option to 64BIT_BUILD_DONT_WORK
* add --64-bit-dont-work to build.sh
2014-09-12 20:10:14 +02:00
Gregory Hainaut 61088b71c6 cmake: gcc warning management
* 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...
2014-08-03 14:43:08 +02:00
Gregory Hainaut f38c6d0995 Merge pull request #142 from Sonicadvance1/fPIC_x86_64
Enable -fPIC on x86_64.
2014-07-30 00:01:08 +02:00
Gregory Hainaut d09fee90ad wx3.0: add cmake support (2.8 by default)
use ./build.sh --wx30 for wx3.0
2014-07-29 20:45:43 +02:00
Ryan Houdek 8c07d4e7b9 Enable -fPIC on x86_64.
-fPIC is required on x86_64 for shared libraries.
This allows the compilation to get farther in to plugin compiling.
2014-07-26 03:08:35 -05:00
Ryan Houdek a1a0ed0563 Support _M_X86[_32/_64] on Linux.
These go hand in hand with PR #109 but for Linux as well.

These are much more useful defines than what other compilers give us.
2014-07-14 23:58:02 -05:00
Gregory Hainaut f85a4c0467 clang: don't use clang asm tool
-no-integrated-as fixes most of the asm issue :)
2014-07-14 13:58:06 +02:00
Gregory Hainaut c60fefa1a6 gcc: support address sanitizer 2014-07-12 19:57:26 +02:00
Gregory Hainaut 8c03d50421 cmake: remove a specific warning for clang 2014-07-12 16:04:57 +02:00
Gregory Hainaut f401f817ed cmake: sdl opt typo + clean warning management
Add back a lots of warning in the core!
2014-07-12 12:59:23 +02:00
Ryan Houdek 1f188b2610 Remove -march argument on x86_64 build option.
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.
2014-07-11 14:32:17 -05:00
Gregory Hainaut 1dba4aceca cmake: reduce a bit cmake syntax cluttering 2014-07-05 15:08:39 +02:00
Gregory Hainaut e8b3532658 cmake: clean main file and option
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)
2014-07-05 14:54:56 +02:00
Ryan Houdek 35979bb5a6 Add a CMake compile time option for building a 64bit binary.
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
2014-07-05 05:09:17 -05:00
Gregory Hainaut b7536ca94b zzogl: gcc warning fix
Let's hope variadic macro work on visual

cmake: reenable various warning. With previous fixes it just a matter of a couple of warnings
2014-05-03 10:37:58 +02:00
Gregory Hainaut c37d9c10f7 cmake: git compilation issue + useless warning message
* 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
2014-04-17 20:26:16 +02:00