Ticket #2330: c++11.diff

File c++11.diff, 2.0 KB (added by fabio, 10 years ago)
  • build/premake/premake4.lua

    What: see http://trac.wildfiregames.com/ticket/2330
    When: 2013-12-29
    Who: Fabio Pedretti
    
     
    1616newoption { trigger = "with-system-enet", description = "Search standard paths for libenet, instead of using bundled copy" }
    1717newoption { trigger = "with-system-miniupnpc", description = "Search standard paths for libminiupnpc, instead of using bundled copy" }
    1818newoption { trigger = "with-system-mozjs185", description = "Search standard paths for libmozjs185, instead of using bundled copy" }
    19 newoption { trigger = "with-c++11", description = "Enable C++11 on GCC" }
    2019newoption { trigger = "sysroot", description = "Set compiler system root path, used for building against a non-system SDK. For example /usr/local becomes SYSROOT/user/local" }
    2120newoption { trigger = "macosx-version-min", description = "Set minimum required version of the OS X API, the build will possibly fail if an older SDK is used, while newer API functions will be weakly linked (i.e. resolved at runtime)" }
    2221newoption { trigger = "macosx-bundle", description = "Enable OSX bundle, the argument is the bundle identifier string (e.g. com.wildfiregames.0ad)" }
     
    106105        minor = 0+minor
    107106        has_broken_pch = (major < 4 or (major == 4 and minor < 2))
    108107        if has_broken_pch then
    109             print("WARNING: Detected GCC <4.2 -- disabling PCH for Atlas (will increase build times)")
     108            print("WARNING: Detected GCC < 4.2 -- disabling PCH for Atlas (will increase build times)")
    110109        end
    111110    end
    112111end
     
    288287                end
    289288            end
    290289           
    291             if _OPTIONS["with-c++11"] then
     290            has_cpp11 = (major > 4 or (major == 4 and minor >= 8))
     291            if has_cpp11 then
    292292                buildoptions {
    293293                    -- Enable C++11 standard. VS2010 and higher automatically support C++11
    294294                    -- but we have to enable it manually on GNU C++ and Intel C++
    295                     "-std=c++0x"
     295                    "-std=c++11"
    296296                }
    297297            end
    298298