From c44df3d93233ec14447009b05c29ae5dde94464f Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 23 Apr 2014 04:11:41 -0500 Subject: [PATCH 1/2] Moves a few Cmake options so that debug options are near one another. Moves GDBSTUB to the top as well where it should be. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e6609e72a..b711230c19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,10 +11,12 @@ option(USE_UPNP "Enables UPnP port mapping support" ON) option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) option(ENABLE_PCH "Use PCH to speed up compilation" ON) -option(FASTLOG "Enable all logs" OFF) -option(OPROFILING "Enable profiling" OFF) option(OPENMP "Enable OpenMP parallelization" ON) option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) + +option(FASTLOG "Enable all logs" OFF) +option(OPROFILING "Enable profiling" OFF) +option(GDBSTUB "Enable gdb stub for remote debugging." OFF) ######################################## # Optional Targets # TODO: Add DSPSpy @@ -306,7 +308,6 @@ if(FASTLOG) add_definitions(-DDEBUGFAST) endif() -option(GDBSTUB "Enable gdb stub for remote debugging." OFF) if(GDBSTUB) add_definitions(-DUSE_GDBSTUB) endif(GDBSTUB) From cc2dac672216048678f01a1c72b0d5c04be88fb5 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 23 Apr 2014 04:15:25 -0500 Subject: [PATCH 2/2] Adds Link Time Optimization cmake option. Adds a LTO option that isn't enabled by default. Allows building release binaries with link time optimizations without generating a -dirty build. Not enabled by default due to concerns of memory usage and increased build time. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b711230c19..f1f5f42adc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ option(USE_WAYLAND "Enables Wayland Support" OFF) option(USE_UPNP "Enables UPnP port mapping support" ON) option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) option(ENABLE_PCH "Use PCH to speed up compilation" ON) +option(ENABLE_LTO "Enables Link Time Optimization" OFF) option(OPENMP "Enable OpenMP parallelization" ON) option(ENCODE_FRAMEDUMPS "Encode framedumps in AVI format" ON) @@ -206,6 +207,10 @@ if(UNIX AND NOT APPLE) check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden) endif() +if(ENABLE_LTO) + check_and_add_flag(LTO -flto) +endif() + if(APPLE) # Ignore MacPorts and Fink and any other locally installed packages that # might prevent building a distributable binary.