diff --git a/.travis.yml b/.travis.yml index fe4867a7cfd7..f683ee2f2020 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ script: ./utils/travis/check_utf8.sh; ./utils/travis/utf8_bom_dog.sh; "$CXX" --version; - scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool="$CC" cxxtool="$CXX" --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=true cxx_std="$CXXSTD" nls="$NLS" jobs=2; + scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool="$CC" cxxtool="$CXX" --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict=true cxx_std="$CXXSTD" nls="$NLS" jobs=2 enable_lto=false; else export DISPLAY=:99.0; /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24; diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e3419389b4e..6724da0e9450 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,10 +151,14 @@ option(ENABLE_STRICT_COMPILATION "Sets the strict compilation mode" OFF) option(ENABLE_PEDANTIC_COMPILATION "Sets the pedantic compilation mode" OFF) option(ENABLE_DEBUG_WINDOW_LAYOUT "Add the debug option to allow the generation of debug layout files in dot format" OFF) option(ENABLE_DESIGN_DOCUMENTS "Enables the generation of design documents, and has additional dependencies" OFF) -option(ENABLE_LTO "Sets Link Time Optimization for Release builds" OFF) +option(ENABLE_LTO "Sets Link Time Optimization for Release builds" ON) option(GLIBCXX_DEBUG "Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC" OFF) option(ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF) +if(WIN32) + set(ENABLE_LTO OFF) +endif(WIN32) + if(UNIX AND NOT APPLE AND NOT CYGWIN) option(ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON) endif(UNIX AND NOT APPLE AND NOT CYGWIN) diff --git a/SConstruct b/SConstruct index e4ec35fb761b..02dc47349552 100755 --- a/SConstruct +++ b/SConstruct @@ -53,7 +53,7 @@ opts.AddVariables( ('extra_flags_release', 'Extra compiler and linker flags to use for release builds', ""), ('extra_flags_debug', 'Extra compiler and linker flags to use for debug builds', ""), ('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""), - BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', False), + BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', True), ('arch', 'What -march option to use for build=release, will default to pentiumpro on Windows', ""), BoolVariable('glibcxx_debug', 'Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC for build=debug', False), EnumVariable('profiler', 'profiler to be used for build=profile', "gprof", ["gprof", "gcov", "gperftools", "perf"]), @@ -504,6 +504,10 @@ for env in [test_env, client_env, env]: # Start setting options for release build # # +# disable LTO for Windows only - does not work with TDM-GCC + if env["PLATFORM"] == "win32": + env["enable_lto"] = False + # default compiler flags rel_comp_flags = "-O3" rel_link_flags = "" diff --git a/docker_run.sh b/docker_run.sh index b9a7fcda9043..72b108c61b58 100755 --- a/docker_run.sh +++ b/docker_run.sh @@ -49,9 +49,9 @@ if [ "$NLS" == "true" ]; then else # if not doing the translations, build wesnoth, wesnothd, campaignd, boost_unit_tests if [ "$TOOL" == "cmake" ]; then - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" && make VERBOSE=1 -j2 + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO=false && make VERBOSE=1 -j2 else - scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2 + scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2 enable_lto=false fi # check if the build was successful