Ticket #2191: premake4_SSE2_C++11.patch

File premake4_SSE2_C++11.patch, 2.2 KB (added by Jorma Rebane, 11 years ago)

Adds SSE2 to Windows build and optional C++11 build option

  • premake/premake4.lua

     
    1313newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" }
    1414newoption { trigger = "with-system-enet", description = "Search standard paths for libenet, instead of using bundled copy" }
    1515newoption { trigger = "with-system-mozjs185", description = "Search standard paths for libmozjs185, instead of using bundled copy" }
     16newoption { trigger = "with-c++11", description = "Enable C++11 on GCC" }
    1617newoption { trigger = "sysroot", description = "Set compiler system root path, used for building against a non-system SDK. For example /usr/local becomes SYSROOT/user/local" }
    1718newoption { 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)" }
    1819newoption { trigger = "macosx-bundle", description = "Enable OSX bundle, the argument is the bundle identifier string (e.g. com.wildfiregames.0ad)" }
     
    182183
    183184        -- use native wchar_t type (not typedef to unsigned short)
    184185        flags { "NativeWChar" }
     186        flags { "EnableSSE2" } -- Enable SSE2 code generation for VS
    185187
    186188        -- VC++ 2008 has implied FPO as the default (newer versions default to /Oy-)
    187189        -- disable it explicitly since it breaks our stack walker in release build
     
    270272                        "-march=i686"
    271273                    }
    272274                end
    273 
    274275            end
     276           
     277            if _OPTIONS["with-c++11"] then
     278                buildoptions {
     279                    -- Enable C++11 standard. VS2010 and higher automatically support C++11
     280                    -- but we have to enable it manually on GNU C++ and Intel C++
     281                    "-std=c++0x"
     282                }
     283            end
    275284
    276285            if arch == "arm" then
    277286                -- disable warnings about va_list ABI change
     
    12551264
    12561265        -- see wstartup.h
    12571266        linkoptions { "/INCLUDE:_wstartup_InitAndRegisterShutdown" }
     1267        -- Enables console for the TEST project on Windows
     1268        linkoptions { "/SUBSYSTEM:CONSOLE" }
    12581269
    12591270        project_add_manifest()
    12601271