Skip to content

Commit dd9b51c

Browse files
committed
fix daslang compile on unix
1 parent 17f62d6 commit dd9b51c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

xmake.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ package("daslang")
1414
add_deps("cmake")
1515

1616
on_install(function (package)
17+
io.replace("CMakeCommon.txt", "-fno-rtti", "-frtti", {plain = true})
18+
io.replace("CMakeCommon.txt", "-fno-exceptions", "-fexceptions", {plain = true})
19+
1720
local configs = {
1821
"-DDAS_TOOLS_DISABLED=ON",
1922
"-DDAS_TESTS_DISABLED=ON",
@@ -34,6 +37,8 @@ package("daslang")
3437
"-DDAS_STBIMAGE_DISABLED=ON",
3538
"-DDAS_URIPARSER_DISABLED=ON",
3639
"-DDAS_STBTRUETYPE_DISABLED=ON",
40+
"-DBUILD_SHARED_LIBS=OFF",
41+
"-DDAS_DYNAMIC_DISABLED=ON",
3742
}
3843

3944
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
@@ -43,6 +48,10 @@ package("daslang")
4348
table.insert(configs, "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON")
4449
end
4550

51+
if not package:is_plat("windows") then
52+
table.insert(configs, "-DCMAKE_CXX_FLAGS=-frtti -fexceptions")
53+
end
54+
4655
import("package.tools.cmake").install(package, configs)
4756
end)
4857
package_end()
@@ -81,6 +90,7 @@ target("GrnGame")
8190
"GRNGAME_LINUX",
8291
"_GNU_SOURCE", -- So we get access to GNU/Posix extensions
8392
{ public = true })
93+
add_cxxflags("-frtti", "-fexceptions")
8494
elseif is_plat("windows") then
8595
add_defines("GRNGAME_WINDOWS", { public = true })
8696
elseif is_plat("macos") then

0 commit comments

Comments
 (0)