Changeset View
Changeset View
Standalone View
Standalone View
build/premake/premake5.lua
Show First 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | function setup_static_lib_project (project_name, rel_source_dirs, extern_libs, extra_params) | ||||
project_create(project_name, target_type) | project_create(project_name, target_type) | ||||
project_add_contents(source_root, rel_source_dirs, {}, extra_params) | project_add_contents(source_root, rel_source_dirs, {}, extra_params) | ||||
project_add_extern_libs(extern_libs, target_type) | project_add_extern_libs(extern_libs, target_type) | ||||
if not extra_params["no_default_link"] then | if not extra_params["no_default_link"] then | ||||
table.insert(static_lib_names, project_name) | table.insert(static_lib_names, project_name) | ||||
end | end | ||||
if os.istarget("windows") then | -- Deactivate Run Time Type Information. Performance of dynamic_cast is very poor. | ||||
-- The exception to this principle is Atlas UI, which is not a static library. | |||||
rtti "off" | rtti "off" | ||||
wraitii: We inherit from a spidermonkey class for the proxy and that's compiled without RTTI.
Given that… | |||||
elseif os.istarget("macosx") and _OPTIONS["macosx-version-min"] then | |||||
if os.istarget("macosx") and _OPTIONS["macosx-version-min"] then | |||||
xcodebuildsettings { MACOSX_DEPLOYMENT_TARGET = _OPTIONS["macosx-version-min"] } | xcodebuildsettings { MACOSX_DEPLOYMENT_TARGET = _OPTIONS["macosx-version-min"] } | ||||
end | end | ||||
end | end | ||||
function setup_third_party_static_lib_project (project_name, rel_source_dirs, extern_libs, extra_params) | function setup_third_party_static_lib_project (project_name, rel_source_dirs, extern_libs, extra_params) | ||||
setup_static_lib_project(project_name, rel_source_dirs, extern_libs, extra_params) | setup_static_lib_project(project_name, rel_source_dirs, extern_libs, extra_params) | ||||
includedirs { source_root .. "third_party/" .. project_name .. "/include/" } | includedirs { source_root .. "third_party/" .. project_name .. "/include/" } | ||||
end | end | ||||
function setup_shared_lib_project (project_name, rel_source_dirs, extern_libs, extra_params) | function setup_shared_lib_project (project_name, rel_source_dirs, extern_libs, extra_params) | ||||
local target_type = "SharedLib" | local target_type = "SharedLib" | ||||
project_create(project_name, target_type) | project_create(project_name, target_type) | ||||
project_add_contents(source_root, rel_source_dirs, {}, extra_params) | project_add_contents(source_root, rel_source_dirs, {}, extra_params) | ||||
project_add_extern_libs(extern_libs, target_type) | project_add_extern_libs(extern_libs, target_type) | ||||
if not extra_params["no_default_link"] then | if not extra_params["no_default_link"] then | ||||
table.insert(static_lib_names, project_name) | table.insert(static_lib_names, project_name) | ||||
end | end | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
rtti "off" | |||||
links { "delayimp" } | links { "delayimp" } | ||||
elseif os.istarget("macosx") and _OPTIONS["macosx-version-min"] then | elseif os.istarget("macosx") and _OPTIONS["macosx-version-min"] then | ||||
xcodebuildsettings { MACOSX_DEPLOYMENT_TARGET = _OPTIONS["macosx-version-min"] } | xcodebuildsettings { MACOSX_DEPLOYMENT_TARGET = _OPTIONS["macosx-version-min"] } | ||||
end | end | ||||
end | end | ||||
-- this is where the source tree is chopped up into static libs. | -- this is where the source tree is chopped up into static libs. | ||||
▲ Show 20 Lines • Show All 395 Lines • ▼ Show 20 Lines | local extra_params = { | ||||
extra_files = { "main.cpp" }, | extra_files = { "main.cpp" }, | ||||
no_pch = 1 | no_pch = 1 | ||||
} | } | ||||
project_add_contents(source_root, {}, {}, extra_params) | project_add_contents(source_root, {}, {}, extra_params) | ||||
project_add_extern_libs(used_extern_libs, target_type) | project_add_extern_libs(used_extern_libs, target_type) | ||||
dependson { "Collada" } | dependson { "Collada" } | ||||
rtti "off" | |||||
-- Platform Specifics | -- Platform Specifics | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
files { source_root.."lib/sysdep/os/win/icon.rc" } | files { source_root.."lib/sysdep/os/win/icon.rc" } | ||||
-- from "lowlevel" static lib; must be added here to be linked in | -- from "lowlevel" static lib; must be added here to be linked in | ||||
files { source_root.."lib/sysdep/os/win/error_dialog.rc" } | files { source_root.."lib/sysdep/os/win/error_dialog.rc" } | ||||
rtti "off" | |||||
linkoptions { | linkoptions { | ||||
-- wraps main thread in a __try block(see wseh.cpp). replace with mainCRTStartup if that's undesired. | -- wraps main thread in a __try block(see wseh.cpp). replace with mainCRTStartup if that's undesired. | ||||
"/ENTRY:wseh_EntryPoint", | "/ENTRY:wseh_EntryPoint", | ||||
-- see wstartup.h | -- see wstartup.h | ||||
"/INCLUDE:_wstartup_InitAndRegisterShutdown", | "/INCLUDE:_wstartup_InitAndRegisterShutdown", | ||||
-- allow manual unload of delay-loaded DLLs | -- allow manual unload of delay-loaded DLLs | ||||
▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | extra_params = { | ||||
extra_files = { "test_setup.cpp" }, | extra_files = { "test_setup.cpp" }, | ||||
} | } | ||||
project_add_contents(source_root, {}, {}, extra_params) | project_add_contents(source_root, {}, {}, extra_params) | ||||
project_add_extern_libs(used_extern_libs, target_type) | project_add_extern_libs(used_extern_libs, target_type) | ||||
dependson { "Collada" } | dependson { "Collada" } | ||||
rtti "off" | |||||
-- TODO: should fix the duplication between this OS-specific linking | -- TODO: should fix the duplication between this OS-specific linking | ||||
-- code, and the similar version in setup_main_exe | -- code, and the similar version in setup_main_exe | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
-- from "lowlevel" static lib; must be added here to be linked in | -- from "lowlevel" static lib; must be added here to be linked in | ||||
files { source_root.."lib/sysdep/os/win/error_dialog.rc" } | files { source_root.."lib/sysdep/os/win/error_dialog.rc" } | ||||
rtti "off" | |||||
-- see wstartup.h | -- see wstartup.h | ||||
linkoptions { "/INCLUDE:_wstartup_InitAndRegisterShutdown" } | linkoptions { "/INCLUDE:_wstartup_InitAndRegisterShutdown" } | ||||
-- Enables console for the TEST project on Windows | -- Enables console for the TEST project on Windows | ||||
linkoptions { "/SUBSYSTEM:CONSOLE" } | linkoptions { "/SUBSYSTEM:CONSOLE" } | ||||
project_add_manifest() | project_add_manifest() | ||||
elseif os.istarget("linux") or os.istarget("bsd") then | elseif os.istarget("linux") or os.istarget("bsd") then | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
We inherit from a spidermonkey class for the proxy and that's compiled without RTTI.
Given that our code convention preclude using it, I feel like it's fine.
Needs to be tested on more compilers though.