1
0
forked from 0ad/0ad

Fixes FreeBSD build on 12.2

- Fix compiler warning with Clang
- Fix usage of libiconv
- Fix an incorrect SSE macro in NVTT for SSE

Patch by: @madpilot and Stan
Fixes: #5255
Differential Revision: https://code.wildfiregames.com/D3421
This was SVN commit r24704.
This commit is contained in:
Stan 2021-01-19 16:59:53 +00:00
parent e10202d64d
commit 078b4100c1
2 changed files with 15 additions and 15 deletions

View File

@ -351,8 +351,8 @@ extern_lib_defs = {
add_default_include_paths("iconv")
defines { "LIBICONV_STATIC" }
elseif os.getversion().description == "FreeBSD" then
defines { "HAVE_ICONV_CONST" }
defines { "ICONV_CONST=const" }
-- On FreeBSD you need this flag to tell it to use the BSD libc iconv
defines { "LIBICONV_PLUG" }
end
end,
link_settings = function()
@ -366,14 +366,6 @@ extern_lib_defs = {
no_delayload = 1,
})
-- glibc (used on Linux and GNU/kFreeBSD) has iconv
-- FreeBSD 10+ has iconv as a part of libc
if os.istarget("bsd")
and not (os.getversion().description == "FreeBSD" and os.getversion().majorversion >= 10
or os.getversion().description == "GNU/kFreeBSD") then
add_default_links({
bsd_names = { "iconv" },
})
end
end,
},
icu = {

View File

@ -42,6 +42,8 @@ if os.istarget("macosx") then
cc = "clang"
elseif os.istarget("linux") and _OPTIONS["icc"] then
cc = "icc"
elseif os.istarget("bsd") and os.getversion().description == "FreeBSD" then
cc = "clang"
elseif not os.istarget("windows") then
cc = os.getenv("CC")
if cc == nil or cc == "" then
@ -1103,8 +1105,13 @@ function setup_atlas_project(project_name, target_type, rel_source_dirs, rel_inc
links { "winmm", "delayimp" }
elseif os.istarget("linux") or os.istarget("bsd") then
buildoptions { "-rdynamic", "-fPIC" }
linkoptions { "-fPIC", "-rdynamic" }
if os.getversion().description == "FreeBSD" then
buildoptions { "-fPIC" }
linkoptions { "-fPIC" }
else
buildoptions { "-rdynamic", "-fPIC" }
linkoptions { "-fPIC", "-rdynamic" }
end
-- warnings triggered by wxWidgets
buildoptions { "-Wno-unused-local-typedefs" }
@ -1252,9 +1259,10 @@ function setup_collada_project(project_name, target_type, rel_source_dirs, rel_i
-- FCollada is not aliasing-safe, so disallow dangerous optimisations
-- (TODO: It'd be nice to fix FCollada, but that looks hard)
buildoptions { "-fno-strict-aliasing" }
buildoptions { "-rdynamic" }
linkoptions { "-rdynamic" }
if os.getversion().description ~= "FreeBSD" then
buildoptions { "-rdynamic" }
linkoptions { "-rdynamic" }
end
elseif os.istarget("bsd") then
if os.getversion().description == "OpenBSD" then