Adds 64bits support.

This commit is contained in:
Vladislav Belov
2025-04-26 20:53:09 +02:00
parent 8a40673dab
commit b0160d0ece
5 changed files with 76 additions and 15 deletions
+25 -5
View File
@@ -9,13 +9,21 @@
if os.istarget("macosx") then
libraries_dir = rootdir.."/libraries/macos/"
elseif os.istarget("windows") then
libraries_dir = rootdir.."/libraries/win32/"
if arch == "amd64" then
libraries_dir = rootdir.."/libraries/win64/"
else
libraries_dir = rootdir.."/libraries/win32/"
end
else
-- No Unix-specific libs yet (use source directory instead!)
end
-- directory for shared, bundled libraries
if os.istarget("windows") then
libraries_source_dir = rootdir.."/libraries/win32/"
if arch == "amd64" then
libraries_source_dir = rootdir.."/libraries/win64/"
else
libraries_source_dir = rootdir.."/libraries/win32/"
end
else
libraries_source_dir = rootdir.."/libraries/source/"
end
@@ -134,6 +142,10 @@ local function add_default_links(def)
names = def.unix_names
end
local arch_suffix = ""
if os.istarget("windows") and arch == "amd64" then
arch_suffix = "64"
end
local suffix = "d"
-- library is overriding default suffix (typically "" to indicate there is none)
if def["dbg_suffix"] then
@@ -146,6 +158,8 @@ local function add_default_links(def)
suffix = ""
end
suffix = arch_suffix .. suffix
for i,name in pairs(names) do
filter "Debug"
links { name .. suffix }
@@ -712,9 +726,15 @@ extern_lib_defs = {
link_settings = function()
if os.istarget("windows") then
add_default_lib_paths("vorbis")
add_default_links({
win_names = { "libvorbisfile" },
})
if arch == "amd64" then
add_default_links({
win_names = { "vorbisfile" },
})
else
add_default_links({
win_names = { "libvorbisfile" },
})
end
else
pkgconfig.add_links("vorbisfile")
end
+35 -8
View File
@@ -44,8 +44,6 @@ end
-- Root directory of project checkout relative to this .lua file
rootdir = "../.."
dofile("extern_libs5.lua")
-- detect compiler for non-Windows
if os.istarget("macosx") then
cc = "clang"
@@ -117,6 +115,9 @@ else
end
end
-- External libraries should know about arch.
dofile("extern_libs5.lua")
-- Test whether we need to link libexecinfo.
-- This is mostly the case on musl systems, as well as on BSD systems : only glibc provides the
-- backtrace symbols we require in the libc, for other libcs we use the libexecinfo library.
@@ -538,7 +539,11 @@ function project_add_manifest()
-- To use XP-style themed controls, we need to use the manifest to specify the
-- desired version. (This must be set in the game's .exe in order to affect Atlas.)
-- We can remove it once we remove wxWidgets
linkoptions { "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df'\"" }
if arch == "amd64" then
linkoptions { "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df'\"" }
else
linkoptions { "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df'\"" }
end
end
--------------------------------------------------------------------------------
@@ -577,7 +582,11 @@ function setup_static_lib_project (project_name, rel_source_dirs, extern_libs, e
-- The exception to this principle is Atlas UI, which is not a static library.
rtti "off"
if os.istarget("macosx") then
if os.istarget("windows") then
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("macosx") then
architecture(macos_arch)
buildoptions { "-arch " .. macos_arch }
linkoptions { "-arch " .. macos_arch }
@@ -607,6 +616,9 @@ function setup_shared_lib_project (project_name, rel_source_dirs, extern_libs, e
if os.istarget("windows") then
links { "delayimp" }
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("macosx") then
architecture(macos_arch)
buildoptions { "-arch " .. macos_arch }
@@ -1083,7 +1095,11 @@ function setup_main_exe ()
end
-- see manifest.cpp
project_add_manifest()
project_add_manifest(arch)
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("linux") or os.istarget("bsd") then
@@ -1161,6 +1177,9 @@ function setup_atlas_project(project_name, target_type, rel_source_dirs, rel_inc
if os.istarget("windows") then
-- Link to required libraries
links { "winmm", "delayimp" }
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("macosx") then
architecture(macos_arch)
@@ -1285,7 +1304,10 @@ function setup_atlas_frontend_project (project_name)
-- Platform Specifics
if os.istarget("windows") then
-- see manifest.cpp
project_add_manifest()
project_add_manifest(arch)
if arch == "amd64" then
architecture("x86_64")
end
else -- Non-Windows, = Unix
links { "AtlasObject" }
@@ -1321,6 +1343,9 @@ function setup_collada_project(project_name, target_type, rel_source_dirs, rel_i
-- Platform Specifics
if os.istarget("windows") then
characterset "MBCS"
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("linux") then
defines { "LINUX" }
@@ -1374,7 +1399,6 @@ function setup_collada_projects()
},{ -- include
},{ -- extern_libs
"fcollada",
"iconv",
"libxml2"
},{ -- extra_params
})
@@ -1482,7 +1506,10 @@ function setup_tests()
links { "delayimp" }
project_add_manifest()
project_add_manifest(arch)
if arch == "amd64" then
architecture("x86_64")
end
elseif os.istarget("linux") or os.istarget("bsd") then
+9
View File
@@ -29,12 +29,21 @@
#include <vorbis/vorbisfile.h>
// TODO: remove hardcoded libraries.
#if MSC_VERSION
#if _WIN64
# ifdef NDEBUG
# pragma comment(lib, "vorbisfile.lib")
# else
# pragma comment(lib, "vorbisfiled.lib")
# endif
#else
# ifdef NDEBUG
# pragma comment(lib, "libvorbisfile.lib")
# else
# pragma comment(lib, "libvorbisfiled.lib")
# endif
#endif
#endif
#endif // #ifndef INCLUDED_VORBIS
+3 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -38,15 +38,16 @@
// Windows
#if defined(_WIN64)
# define OS_WIN 1
# define OS_WIN64 1
#else
# define OS_WIN64 0
#endif
#if defined(_WIN32)
# define OS_WIN 1
#else
# define OS_WIN 0
#endif
#endif
// Linux
#if defined(linux) || defined(__linux) || defined(__linux__)
# define OS_LINUX 1
+4
View File
@@ -162,7 +162,11 @@ static const wchar_t* GetSehExceptionDescription(const EXCEPTION_RECORD* er,
// special case: display type and address.
const wchar_t* accessType = (ei[0])? L"writing" : L"reading";
const ULONG_PTR address = ei[1];
#if defined(_WIN64)
swprintf_s(description, maxChars, L"Access violation %ls 0x%08llX", accessType, address);
#else
swprintf_s(description, maxChars, L"Access violation %ls 0x%08X", accessType, address);
#endif
return description;
}
case EXCEPTION_DATATYPE_MISALIGNMENT: return L"Datatype misalignment";