Ticket #1619: largeaddressaware.patch

File largeaddressaware.patch, 3.6 KB (added by echotangoecho, 8 years ago)

Allows the executable to use more than 2GB of ram on windows, and seems to fix this issue.

  • build/premake/premake4.lua

    function project_set_build_flags()  
    214214        -- use native wchar_t type (not typedef to unsigned short)
    215215        flags { "NativeWChar" }
    216216
    217217    else    -- *nix
    218218
    219         -- TODO, FIXME: This check is incorrect because it means that some additional flags will be added inside the "else" branch if the 
     219        -- TODO, FIXME: This check is incorrect because it means that some additional flags will be added inside the "else" branch if the
    220220        -- compiler is ICC and minimal-flags is specified (ticket: #2994)
    221221        if cc == "icc" and not _OPTIONS["minimal-flags"] then
    222222            buildoptions {
    223223                "-w1",
    224224                -- "-Wabi",
    function project_set_build_flags()  
    294294                        -- Note that all these features are already supported on amd64.
    295295                        "-march=pentium3 -mtune=generic"
    296296                    }
    297297                end
    298298            end
    299            
     299
    300300            buildoptions {
    301301                -- Enable C++11 standard.
    302302                "-std=c++0x"
    303303            }
    304304
    function project_set_build_flags()  
    377377                    linkoptions { "-Wl,-z,origin" }
    378378                end
    379379
    380380                -- Adding the executable path and taking care of correct escaping
    381381                if _ACTION == "gmake" then
    382                     linkoptions { "-Wl,-rpath,'$$ORIGIN'" } 
     382                    linkoptions { "-Wl,-rpath,'$$ORIGIN'" }
    383383                elseif _ACTION == "codeblocks" then
    384384                    linkoptions { "-Wl,-R\\\\$$$ORIGIN" }
    385385                end
    386386            end
    387387        end
    function setup_all_libs ()  
    605605    extern_libs = {
    606606        "iconv",
    607607        "boost",
    608608    }
    609609    setup_third_party_static_lib_project("tinygettext", source_dirs, extern_libs, { } )
    610    
     610
    611611    -- it's an external library and we don't want to modify its source to fix warnings, so we just disable them to avoid noise in the compile output
    612612    if _ACTION == "vs2013" then
    613         buildoptions { 
     613        buildoptions {
    614614            "/wd4127",
    615615            "/wd4309",
    616616            "/wd4800",
    617617            "/wd4100",
    618618            "/wd4996",
    function setup_all_libs ()  
    728728        "libcurl",
    729729        "tinygettext",
    730730        "icu",
    731731        "iconv",
    732732    }
    733    
     733
    734734    if not _OPTIONS["without-audio"] then
    735735        table.insert(extern_libs, "openal")
    736736        table.insert(extern_libs, "vorbis")
    737737    end
    738    
     738
    739739    setup_static_lib_project("engine", source_dirs, extern_libs, {})
    740740
    741741
    742742    source_dirs = {
    743743        "graphics",
    function setup_all_libs ()  
    841841        bsd = { "lib/sysdep/os/bsd", "lib/sysdep/os/unix", "lib/sysdep/os/unix/x" },
    842842    }
    843843    for i,v in pairs(sysdep_dirs[os.get()]) do
    844844        table.insert(source_dirs, v);
    845845    end
    846    
     846
    847847    if os.is("linux") then
    848848        if _OPTIONS["android"] then
    849849            table.insert(source_dirs, "lib/sysdep/os/android")
    850850        else
    851851            table.insert(source_dirs, "lib/sysdep/os/unix/x")
    function setup_main_exe ()  
    970970            -- see wstartup.h
    971971            "/INCLUDE:_wstartup_InitAndRegisterShutdown",
    972972
    973973            -- allow manual unload of delay-loaded DLLs
    974974            "/DELAY:UNLOAD",
     975
     976            -- allow the executable to use more than 2 GB of ram.
     977            "/LARGEADDRESSAWARE",
    975978        }
    976979
    977980        -- see manifest.cpp
    978981        project_add_manifest()
    979982
    function setup_atlas_projects()  
    10861089
    10871090    setup_atlas_project("AtlasObject", "StaticLib",
    10881091    {   -- src
    10891092        ".",
    10901093        "../../../third_party/jsonspirit"
    1091        
     1094
    10921095    },{ -- include
    10931096        "../../../third_party/jsonspirit"
    10941097    },{ -- extern_libs
    10951098        "boost",
    10961099        "iconv",
    function setup_atlas_frontend_project (p  
    11831186    if os.is("windows") then
    11841187        defines { "_UNICODE" }
    11851188
    11861189        -- required to use WinMain() on Windows, otherwise will default to main()
    11871190        flags { "WinMain" }
    1188        
     1191
    11891192        -- see manifest.cpp
    11901193        project_add_manifest()
    11911194
    11921195    else -- Non-Windows, = Unix
    11931196        links { "AtlasObject" }