error on undefined os type + comments/spaces +

This commit is contained in:
otavepto 2024-05-21 23:26:16 +03:00
parent 3a8a53dd72
commit f9c156ca4f

View File

@ -3,13 +3,13 @@ require("premake", ">=5.0.0-beta2")
-- add "-Wl,--whole-archive -Wl,-Bstatic -lmylib -Wl,-Bdynamic -Wl,--no-whole-archive" -- add "-Wl,--whole-archive -Wl,-Bstatic -lmylib -Wl,-Bdynamic -Wl,--no-whole-archive"
-- via: links { 'mylib:static_whole' } -- via: links { 'mylib:static_whole' }
-- https://premake.github.io/docs/Overrides-and-Call-Arrays/#introducing-overrides
premake.override(premake.tools.gcc, "getlinks", function(originalFn, cfg, systemonly, nogroups) premake.override(premake.tools.gcc, "getlinks", function(originalFn, cfg, systemonly, nogroups)
-- source: -- source:
-- premake.tools.gcc.getlinks(cfg, systemonly, nogroups) -- premake.tools.gcc.getlinks(cfg, systemonly, nogroups)
-- https://github.com/premake/premake-core/blob/d842e671c7bc7e09f2eeaafd199fd01e48b87ee7/src/tools/gcc.lua#L568C15-L568C22 -- https://github.com/premake/premake-core/blob/d842e671c7bc7e09f2eeaafd199fd01e48b87ee7/src/tools/gcc.lua#L568C15-L568C22
local result = originalFn(cfg, systemonly, nogroups) local result = originalFn(cfg, systemonly, nogroups)
local total_count = #result
local static_whole_syslibs = {"-Wl,--whole-archive -Wl,-Bstatic"} local static_whole_syslibs = {"-Wl,--whole-archive -Wl,-Bstatic"}
local endswith = function(s, ptrn) local endswith = function(s, ptrn)
@ -53,6 +53,8 @@ if os.target() == "windows" then
elseif os.target() == "linux" then elseif os.target() == "linux" then
os_iden = 'linux' os_iden = 'linux'
deps_folder = "build/deps/linux" deps_folder = "build/deps/linux"
else
error('Unsupported os target: "' .. os.target() .. '"')
end end
local deps_dir = 'build/deps/' .. os_iden .. '/' local deps_dir = 'build/deps/' .. os_iden .. '/'
@ -323,6 +325,7 @@ filter { "system:windows", }
"/utf-8", "/Zc:char8_t-", "/EHsc", "/GL-" "/utf-8", "/Zc:char8_t-", "/EHsc", "/GL-"
} }
linkoptions { linkoptions {
-- source of emittoolversioninfo: https://developercommunity.visualstudio.com/t/add-linker-option-to-strip-rich-stamp-from-exe-hea/740443
"/NOLOGO", "/emittoolversioninfo:no" "/NOLOGO", "/emittoolversioninfo:no"
} }
@ -371,6 +374,7 @@ filter {} -- reset the filter and remove all active keywords
-- post build change DOS stub + sign -- post build change DOS stub + sign
--------- ---------
if os.target() == "windows" then if os.target() == "windows" then
local dos_stub_exe_32 = os.realpath('resources/win/file_dos_stub/file_dos_stub_32.exe') local dos_stub_exe_32 = os.realpath('resources/win/file_dos_stub/file_dos_stub_32.exe')
local dos_stub_exe_64 = os.realpath('resources/win/file_dos_stub/file_dos_stub_64.exe') local dos_stub_exe_64 = os.realpath('resources/win/file_dos_stub/file_dos_stub_64.exe')
local signer_tool = os.realpath('third-party/build/win/cert/sign_helper.bat') local signer_tool = os.realpath('third-party/build/win/cert/sign_helper.bat')
@ -389,6 +393,7 @@ filter { "system:windows", }
'"' .. signer_tool .. '" %[%{!cfg.buildtarget.abspath}]', '"' .. signer_tool .. '" %[%{!cfg.buildtarget.abspath}]',
} }
filter {} -- reset the filter and remove all active keywords filter {} -- reset the filter and remove all active keywords
end end
@ -492,7 +497,7 @@ project "regular"
libdirs { libdirs {
x64_deps_libdir, x64_deps_libdir,
} }
-- End regular
-- Project experimental -- Project experimental
@ -610,7 +615,7 @@ project "experimental"
x64_deps_libdir, x64_deps_libdir,
x64_deps_overlay_libdir, x64_deps_overlay_libdir,
} }
-- End experimental
-- Project steamclient_experimental -- Project steamclient_experimental
@ -735,6 +740,7 @@ project "steamclient_experimental"
x64_deps_libdir, x64_deps_libdir,
x64_deps_overlay_libdir, x64_deps_overlay_libdir,
} }
-- End steamclient_experimental
-- Project tool_lobby_connect -- Project tool_lobby_connect
@ -762,7 +768,6 @@ project "tool_lobby_connect"
includedirs { includedirs {
common_include, common_include,
} }
-- x32 include dir -- x32 include dir
filter { "platforms:x32", } filter { "platforms:x32", }
includedirs { includedirs {
@ -971,13 +976,11 @@ project "steamclient_regular_linux"
includedirs { includedirs {
common_include, common_include,
} }
-- x32 include dir -- x32 include dir
filter { "platforms:x32", } filter { "platforms:x32", }
includedirs { includedirs {
x32_deps_include, x32_deps_include,
} }
-- x64 include dir -- x64 include dir
filter { "platforms:x64", } filter { "platforms:x64", }
includedirs { includedirs {
@ -1012,10 +1015,9 @@ project "steamclient_regular_linux"
libdirs { libdirs {
x64_deps_libdir, x64_deps_libdir,
} }
-- End steamclient_regular_linux (Linux only)
end end
-- LINUX ONLY TARGETS END -- End LINUX ONLY TARGETS
-- ONLY WINDOWS END
-- Workspace END -- Workspace END