mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-26 08:08:28 +03:00
This should make premake5 configuration beta8 friendly.
Improvement for: SpartanJ/ecode#913.
This commit is contained in:
+23
-18
@@ -34,6 +34,11 @@ newoption {
|
||||
}
|
||||
newoption { trigger = "with-static-cpp", description = "Builds statically libstdc++" }
|
||||
|
||||
function is_arm64_arch()
|
||||
local arch = _OPTIONS["arch"]
|
||||
return arch and (arch:lower() == "arm64" or arch:lower() == "aarch64")
|
||||
end
|
||||
|
||||
function get_dll_extension()
|
||||
if os.target() == "macosx" then
|
||||
return "dylib"
|
||||
@@ -266,13 +271,13 @@ end
|
||||
function copy_sdl()
|
||||
local dll_name = get_sdl_dll_name()
|
||||
local version_dir = get_sdl_version_dir()
|
||||
if _OPTIONS["windows-vc-build"] and _OPTIONS["arch"] == "arm64" then
|
||||
if _OPTIONS["windows-vc-build"] and is_arm64_arch() then
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/bin/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/" .. dll_name )
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/bin/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/unit_tests/" .. dll_name )
|
||||
elseif _OPTIONS["windows-vc-build"] then
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/lib/x64/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/" .. dll_name )
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/lib/x64/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/unit_tests/" .. dll_name )
|
||||
elseif _OPTIONS["windows-mingw-build"] and _OPTIONS["arch"] ~= "arm64" then
|
||||
elseif _OPTIONS["windows-mingw-build"] and not is_arm64_arch() then
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/x86_64-w64-mingw32/bin/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/" .. dll_name )
|
||||
os.copyfile( _MAIN_SCRIPT_DIR .. "/src/thirdparty/" .. version_dir .."/x86_64-w64-mingw32/bin/" .. dll_name, _MAIN_SCRIPT_DIR .. "/bin/unit_tests/" .. dll_name )
|
||||
end
|
||||
@@ -297,23 +302,23 @@ end
|
||||
function download_and_extract_dependencies()
|
||||
sdl_version_dir_override = nil
|
||||
|
||||
if _OPTIONS["windows-vc-build"] and _OPTIONS["arch"] == "arm64" then
|
||||
if _OPTIONS["windows-vc-build"] and is_arm64_arch() then
|
||||
sdl_version_dir_override = get_sdl_arm64_version_name()
|
||||
end
|
||||
|
||||
local sdl_version_dir = get_sdl_version_dir()
|
||||
|
||||
if not os.isdir("src/thirdparty/" .. sdl_version_dir) then
|
||||
if _OPTIONS["windows-vc-build"] and _OPTIONS["arch"] == "arm64" then
|
||||
if _OPTIONS["windows-vc-build"] and is_arm64_arch() then
|
||||
download_and_extract_sdl(get_sdl_devel_url("vc_arm64"), sdl_version_dir)
|
||||
copy_sdl()
|
||||
elseif _OPTIONS["windows-vc-build"] then
|
||||
download_and_extract_sdl(get_sdl_devel_url("vc"), sdl_version_dir)
|
||||
copy_sdl()
|
||||
elseif _OPTIONS["windows-mingw-build"] and _OPTIONS["arch"] ~= "arm64" then
|
||||
elseif _OPTIONS["windows-mingw-build"] and not is_arm64_arch() then
|
||||
download_and_extract_sdl(get_sdl_devel_url("mingw"), sdl_version_dir)
|
||||
copy_sdl()
|
||||
elseif _OPTIONS["windows-mingw-build"] and _OPTIONS["arch"] == "arm64" then
|
||||
elseif _OPTIONS["windows-mingw-build"] and is_arm64_arch() then
|
||||
download_and_extract_sdl(get_sdl_devel_url("src"), sdl_version_dir)
|
||||
elseif os.istarget("ios") then
|
||||
download_and_extract_sdl(get_sdl_devel_url("src"), sdl_version_dir)
|
||||
@@ -326,7 +331,7 @@ function build_arch_configuration()
|
||||
buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/i686-w64-mingw32-" }
|
||||
|
||||
filter {"architecture:x86_64", "options:cc=mingw"}
|
||||
if _OPTIONS["arch"] ~= "arm64" then
|
||||
if not is_arm64_arch() then
|
||||
buildoptions { "-D__USE_MINGW_ANSI_STDIO=1 -B /usr/bin/x86_64-w64-mingw32-" }
|
||||
end
|
||||
|
||||
@@ -541,24 +546,24 @@ function build_link_configuration( package_name, use_ee_icon )
|
||||
links { "SDL3" }
|
||||
end
|
||||
|
||||
filter { "options:windows-vc-build", "options:arch=arm64" }
|
||||
filter { "options:windows-vc-build", "options:arch=AARCH64" }
|
||||
syslibdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/lib" }
|
||||
|
||||
filter { "options:windows-vc-build", "system:windows", "platforms:x86" }
|
||||
syslibdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/lib/x86" }
|
||||
|
||||
filter { "options:windows-vc-build", "system:windows", "platforms:x86_64", "not options:arch=arm64" }
|
||||
filter { "options:windows-vc-build", "system:windows", "platforms:x86_64", "not options:arch=AARCH64" }
|
||||
syslibdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/lib/x64" }
|
||||
|
||||
filter { "options:windows-mingw-build", "architecture:x86" }
|
||||
syslibdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/i686-w64-mingw32/lib/", "/usr/i686-w64-mingw32/sys-root/mingw/lib/" }
|
||||
|
||||
filter { "options:windows-mingw-build", "architecture:x86_64" }
|
||||
if _OPTIONS["arch"] ~= "arm64" then
|
||||
if not is_arm64_arch() then
|
||||
syslibdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/x86_64-w64-mingw32/lib/", "/usr/x86_64-w64-mingw32/sys-root/mingw/lib/" }
|
||||
end
|
||||
|
||||
filter { "options:windows-mingw-build", "options:arch=arm64" }
|
||||
filter { "options:windows-mingw-build", "options:arch=AARCH64" }
|
||||
syslibdirs { get_sdl_arm64_cross_tools_path().. "/lib/" }
|
||||
|
||||
filter "system:emscripten"
|
||||
@@ -985,11 +990,11 @@ function build_eepp( build_name )
|
||||
incdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/i686-w64-mingw32/include/" }
|
||||
|
||||
filter { "options:windows-mingw-build", "architecture:x86_64" }
|
||||
if _OPTIONS["arch"] ~= "arm64" then
|
||||
if not is_arm64_arch() then
|
||||
incdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/x86_64-w64-mingw32/include/" }
|
||||
end
|
||||
|
||||
filter { "options:windows-mingw-build", "options:arch=arm64" }
|
||||
filter { "options:windows-mingw-build", "options:arch=AARCH64" }
|
||||
incdirs { get_sdl_arm64_cross_tools_path() .. "/include/" }
|
||||
|
||||
filter "action:vs*"
|
||||
@@ -1025,14 +1030,14 @@ function postsymlinklib_arch(name)
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/x86_64/", _MAIN_SCRIPT_DIR .. "/bin/", name, "architecture:x86_64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm/", _MAIN_SCRIPT_DIR .. "/bin/", name, "architecture:ARM" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/", name, "architecture:AARCH64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/", name, "options:arch=arm64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/", name, "options:arch=AARCH64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/universal/", _MAIN_SCRIPT_DIR .. "/bin/", name, "architecture:universal" )
|
||||
if name == "eepp" then
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/x86/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "architecture:x86" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/x86_64/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "architecture:x86_64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "architecture:ARM" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "architecture:AARCH64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "options:arch=arm64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/arm64/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "options:arch=AARCH64" )
|
||||
postsymlinklib( _MAIN_SCRIPT_DIR .. "/libs/" .. os.target() .. "/universal/", _MAIN_SCRIPT_DIR .. "/bin/unit_tests/", name, "architecture:universal" )
|
||||
end
|
||||
end
|
||||
@@ -1120,7 +1125,7 @@ workspace "eepp"
|
||||
incdirs { "include/thirdparty/glew" }
|
||||
build_base_configuration( "glew" )
|
||||
target_dir_thirdparty()
|
||||
filter { "action:vs*", "options:arch=arm64" }
|
||||
filter { "action:vs*", "options:arch=AARCH64" }
|
||||
buildoptions{ "/bigobj", "/O1", "/Zm200" }
|
||||
|
||||
project "mbedtls-static"
|
||||
@@ -1359,10 +1364,10 @@ workspace "eepp"
|
||||
filter { "options:windows-mingw-build", "architecture:x86" }
|
||||
incdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/i686-w64-mingw32/include/" }
|
||||
filter { "options:windows-mingw-build", "architecture:x86_64" }
|
||||
if _OPTIONS["arch"] ~= "arm64" then
|
||||
if not is_arm64_arch() then
|
||||
incdirs { "src/thirdparty/" .. get_sdl_version_dir() .."/x86_64-w64-mingw32/include/" }
|
||||
end
|
||||
filter { "options:windows-mingw-build", "options:arch=arm64" }
|
||||
filter { "options:windows-mingw-build", "options:arch=AARCH64" }
|
||||
incdirs { get_sdl_arm64_cross_tools_path() .."/include/" }
|
||||
|
||||
project "brotli-static"
|
||||
|
||||
@@ -19,7 +19,7 @@ if ($premakeInPath) {
|
||||
$isArm64 = $arch -eq "arm64"
|
||||
$isSdl3 = $backend -eq "sdl3"
|
||||
$archSuffix = if ($isArm64) { "arm64" } else { "x86_64" }
|
||||
$premakeExtra = if ($isArm64) { "--arch=arm64" } else { "" }
|
||||
$premakeExtra = if ($isArm64) { "--arch=AARCH64" } else { "" }
|
||||
$msbuildPlat = if ($isArm64) { "ARM64" } else { "x64" }
|
||||
$backendArg = if ($isSdl3) { "SDL3" } else { "SDL2" }
|
||||
$sdlDll = if ($isSdl3) { "SDL3.dll" } else { "SDL2.dll" }
|
||||
@@ -51,7 +51,8 @@ if ($msbuildInPath) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
& $msbuildCmd .\make\windows\eepp.sln -m /t:ecode /p:Platform=$msbuildPlat /p:Configuration=release
|
||||
$slnExt = if ($vsAction -eq "vs2026") { "slnx" } else { "sln" }
|
||||
& $msbuildCmd .\make\windows\eepp.$slnExt -m /t:ecode /p:Platform=$msbuildPlat /p:Configuration=release
|
||||
.\projects\scripts\copy_ecode_assets.ps1 .\bin .\projects\windows\ecode\ecode
|
||||
Copy-Item -Path ".\bin\$sdlDll", ".\libs\windows\$archSuffix\eepp.dll", ".\bin\ecode.exe" -Destination ".\projects\windows\ecode\ecode"
|
||||
Compress-Archive -LiteralPath ".\projects\windows\ecode\ecode" -DestinationPath .\projects\windows\ecode\ecode-windows-nightly-msvc-$archSuffix.zip -Force
|
||||
|
||||
@@ -1092,11 +1092,11 @@ void LSPClientPlugin::loadLSPConfig( std::vector<LSPDefinition>& lsps, const std
|
||||
mKeyBindings["lsp-go-to-definition"] = "f2";
|
||||
mKeyBindings["lsp-go-to-implementation"] = "shift+f2";
|
||||
mKeyBindings["lsp-symbol-info"] = "f1";
|
||||
#if EE_PLATFORM == EE_PLATFORM_MACOS
|
||||
#if EE_PLATFORM == EE_PLATFORM_MACOS
|
||||
mKeyBindings["lsp-symbol-code-action"] = "mod+return";
|
||||
#else
|
||||
#else
|
||||
mKeyBindings["lsp-symbol-code-action"] = "alt+return";
|
||||
#endif
|
||||
#endif
|
||||
mKeyBindings["lsp-rename-symbol-under-cursor"] = "mod+shift+r";
|
||||
mKeyBindings["lsp-symbol-references"] = "mod+shift+u";
|
||||
mKeyBindings["lsp-format-range"] = "alt+shift+f";
|
||||
@@ -1156,26 +1156,37 @@ void LSPClientPlugin::loadLSPConfig( std::vector<LSPDefinition>& lsps, const std
|
||||
|
||||
// Allow overriding the command for already defined LSP
|
||||
// And overriding parameters to the already defined LSP
|
||||
if ( updateConfigFile && ( obj.contains( "name" ) || obj.contains( "use" ) ) &&
|
||||
if ( updateConfigFile &&
|
||||
( obj.contains( "name" ) || obj.contains( "use" ) || obj.contains( "language" ) ) &&
|
||||
( obj.contains( "command" ) ||
|
||||
( obj.contains( "command_parameters" ) &&
|
||||
obj.at( "command_parameters" ).is_string() ) ||
|
||||
( obj.contains( "host" ) && obj.at( "host" ).is_string() &&
|
||||
obj.contains( "port " ) && obj.at( "port" ).is_number_integer() ) ||
|
||||
obj.contains( "settings" ) || obj.contains( "initializationOptions" ) ) ) {
|
||||
obj.contains( "settings" ) || obj.contains( "initializationOptions" ) ||
|
||||
obj.contains( "share_process" ) ) ) {
|
||||
for ( auto& lspR : lsps ) {
|
||||
std::string name = obj.contains( "name" ) ? obj["name"] : obj["use"];
|
||||
if ( lspR.name == name ) {
|
||||
std::string name = obj.contains( "name" ) && obj["name"].is_string()
|
||||
? obj.value( "name", "" )
|
||||
: obj.value( "use", "" );
|
||||
std::string lang = obj.value( "language", "" );
|
||||
if ( ( !name.empty() && lspR.name == name ) ||
|
||||
( !lang.empty() && lang == lspR.language ) ) {
|
||||
lspOverwritten = true;
|
||||
if ( obj.contains( "use" ) && obj["use"].is_string() )
|
||||
lspR.usesLSP = obj["use"].get<std::string>();
|
||||
else
|
||||
lspR.usesLSP.clear();
|
||||
|
||||
if ( obj.contains( "share_process" ) && obj["share_process"].is_boolean() ) {
|
||||
lspR.shareProcessWithOtherDefinition = obj["share_process"].get<bool>();
|
||||
}
|
||||
|
||||
if ( obj.contains( "command" ) ) {
|
||||
lspR.command =
|
||||
parseCommand( obj["command"], mManager->getWorkspaceFolder() );
|
||||
}
|
||||
|
||||
if ( !obj.value( "command_parameters", "" ).empty() ) {
|
||||
std::string cmdParam( obj.value( "command_parameters", "" ) );
|
||||
if ( !cmdParam.empty() && cmdParam.front() != ' ' )
|
||||
@@ -1184,16 +1195,20 @@ void LSPClientPlugin::loadLSPConfig( std::vector<LSPDefinition>& lsps, const std
|
||||
LSPClientServer::sanitizeCommand( lspR.commandParameters,
|
||||
mManager->getWorkspaceFolder() );
|
||||
}
|
||||
|
||||
if ( obj.contains( "host" ) ) {
|
||||
lspR.host = obj.value( "host", "" );
|
||||
lspR.port = obj.value( "port", 0 );
|
||||
}
|
||||
|
||||
if ( obj.contains( "settings" ) ) {
|
||||
lspR.settings = obj["settings"];
|
||||
}
|
||||
|
||||
if ( obj.contains( "initializationOptions" ) ) {
|
||||
lspR.initializationOptions = obj["initializationOptions"];
|
||||
}
|
||||
|
||||
tryAddEnv( obj, lspR );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user