Try to start building with C++17 support.

Updated premake in Github flows.
Updated Windows version in Github flows (hope it works).
This commit is contained in:
Martín Lucas Golini
2022-11-02 11:52:17 -03:00
parent 37e946f452
commit c23236a53d
6 changed files with 74 additions and 72 deletions

View File

@@ -17,8 +17,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y wget g++-8 libsdl2-2.0-0 libsdl2-dev libopenal1 libopenal-dev
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-linux.tar.gz
tar xvzf premake-5.0.0-alpha14-linux.tar.gz
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz
tar xvzf premake-5.0.0-beta2-linux.tar.gz
- name: Build
run: |
./premake5 gmake2

View File

@@ -17,8 +17,8 @@ jobs:
run: |
brew install wget
brew install SDL2
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-macosx.tar.gz
tar -xzf premake-5.0.0-alpha14-macosx.tar.gz
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-macosx.tar.gz
tar -xzf premake-5.0.0-beta2-macosx.tar.gz
- name: Build
run: |
./premake5 --with-mojoAL gmake2

View File

@@ -4,9 +4,9 @@ on: [push, pull_request]
jobs:
Windows:
runs-on: windows-2019
runs-on: windows-2022
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -18,12 +18,12 @@ jobs:
- name: Install dependencies
shell: powershell
run: |
Invoke-WebRequest -Uri "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha14/premake-5.0.0-alpha14-windows.zip" -OutFile "premake-5.0.0-alpha14-windows.zip"
Expand-Archive -DestinationPath . -Path premake-5.0.0-alpha14-windows.zip
Invoke-WebRequest -Uri "https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip" -OutFile "premake-5.0.0-beta2-windows.zip"
Expand-Archive -DestinationPath . -Path premake-5.0.0-beta2-windows.zip
- name: Create project
shell: powershell
run: |
./premake5.exe --windows-vc-build --with-mojoal vs2019
./premake5.exe --windows-vc-build --with-mojoal vs2022
- name: Build
shell: cmd
run: |

View File

@@ -442,7 +442,7 @@ function build_link_configuration( package_name, use_ee_icon )
end
if not is_vs() then
buildoptions{ "-std=c++14" }
buildoptions{ "-std=c++17" }
end
if package_name ~= "eepp" and package_name ~= "eepp-static" then
@@ -823,7 +823,7 @@ function build_eepp( build_name )
end
if not is_vs() then
buildoptions{ "-std=c++14" }
buildoptions{ "-std=c++17" }
end
if os.is_real("mingw32") or os.is_real("mingw64") or os.is_real("windows") then
@@ -1029,7 +1029,7 @@ solution "eepp"
includedirs { "src/thirdparty/efsw/include", "src/thirdparty/efsw/src" }
defines { "EFSW_USE_CXX11" }
if not is_vs() then
buildoptions{ "-std=c++14" }
buildoptions{ "-std=c++17" }
end
if os.is("windows") then
@@ -1085,7 +1085,7 @@ solution "eepp"
includedirs { "include", "src/modules/eterm/include/","src/modules/eterm/src/" }
files { "src/modules/eterm/src/**.cpp" }
if not is_vs() then
buildoptions{ "-std=c++14" }
buildoptions{ "-std=c++17" }
end
build_base_cpp_configuration( "eterm" )

View File

@@ -90,10 +90,10 @@ os_links = { }
backends = { }
static_backends = { }
backend_selected = false
remote_sdl2_version = "SDL2-2.0.22"
remote_sdl2_devel_src_url = "https://libsdl.org/release/SDL2-2.0.22.zip"
remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-2.0.22-VC.zip"
remote_sdl2_devel_mingw_url = "https://www.libsdl.org/release/SDL2-devel-2.0.22-mingw.zip"
remote_sdl2_version = "SDL2-2.24.2"
remote_sdl2_devel_src_url = "https://libsdl.org/release/SDL2-2.24.2.zip"
remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-2.24.2-VC.zip"
remote_sdl2_devel_mingw_url = "https://www.libsdl.org/release/SDL2-devel-2.24.2-mingw.zip"
function incdirs( dirs )
if is_xcode() then
@@ -268,7 +268,7 @@ function build_link_configuration( package_name, use_ee_icon )
vpaths { ['Resources/*'] = { "ee.rc", "ee.ico" } }
filter "action:not vs*"
cppdialect "C++14"
cppdialect "C++17"
buildoptions { "-Wall" }
filter { "configurations:debug*", "action:not vs*" }
@@ -620,7 +620,7 @@ function build_eepp( build_name )
incdirs { "src/thirdparty/libzip/vs" }
filter "action:not vs*"
cppdialect "C++14"
cppdialect "C++17"
end
workspace "eepp"
@@ -786,7 +786,7 @@ workspace "eepp"
build_base_cpp_configuration( "efsw" )
defines { "EFSW_USE_CXX11" }
filter "action:not vs*"
cppdialect "C++14"
cppdialect "C++17"
filter "system:windows"
files { "src/thirdparty/efsw/src/efsw/platform/win/*.cpp" }
excludes {
@@ -833,7 +833,7 @@ workspace "eepp"
files { "src/modules/eterm/src/**.cpp" }
build_base_cpp_configuration( "eterm" )
filter "action:not vs*"
cppdialect "C++14"
cppdialect "C++17"
buildoptions { "-Wall" }
-- Library

View File

@@ -267,7 +267,10 @@ static std::vector<LSPDiagnostic> parseDiagnosticsArr( const json& result ) {
auto diag = vdiag;
auto range = parseRange( diag[MEMBER_RANGE] );
auto severity = static_cast<LSPDiagnosticSeverity>( diag["severity"].get<int>() );
auto code = diag.at( "code" ).get<std::string>();
auto code = diag.contains( "code" ) ? ( diag["code"].is_number_integer()
? String::toString( diag["code"].get<int>() )
: diag.at( "code" ).get<std::string>() )
: "";
auto source = diag.at( "source" ).get<std::string>();
auto message = diag.at( MEMBER_MESSAGE ).get<std::string>();
std::vector<LSPDiagnosticRelatedInformation> relatedInfoList;
@@ -462,7 +465,7 @@ LSPClientServer::RequestHandle LSPClientServer::send( const json& msg, const Gen
if ( mProcess.isAlive() ) {
return write( msg, h, eh );
} else {
Log::error( "LSPClientServer server %s Send for non-running server: %s", mLSP.name.c_str(),
Log::debug( "LSPClientServer server %s Send for non-running server: %s", mLSP.name.c_str(),
mLSP.name.c_str() );
}
return RequestHandle();
@@ -609,7 +612,8 @@ static json newError( const LSPErrorCode& code, const std::string& msg ) {
void LSPClientServer::publishDiagnostics( const json& msg ) {
// should emmit event somewhere
auto res = parseDiagnostics( msg[MEMBER_PARAMS] );
Log::debug( "LSPClientServer::publishDiagnostics: %s", res.uri.toString().c_str() );
Log::debug( "LSPClientServer::publishDiagnostics: %s - returned %zu items",
res.uri.toString().c_str(), res.diagnostics.size() );
}
void LSPClientServer::workDoneProgress( const LSPWorkDoneProgressParams& workDoneParams ) {
@@ -673,7 +677,7 @@ void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
// FIXME perhaps detect if no reply for some time
// then again possibly better left to user to restart in such case
if ( !ok ) {
Log::error( "LSPClientServer::readStdOut server %s invalid " CONTENT_LENGTH,
Log::debug( "LSPClientServer::readStdOut server %s invalid " CONTENT_LENGTH,
mLSP.name.c_str() );
// flush and try to carry on to some next header
buffer.erase( 0, msgstart );
@@ -681,7 +685,7 @@ void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
}
// sanity check to avoid extensive buffering
if ( length > ( 1 << 29 ) ) {
Log::error( "LSPClientServer::readStdOut server %s excessive size", mLSP.name.c_str() );
Log::debug( "LSPClientServer::readStdOut server %s excessive size", mLSP.name.c_str() );
buffer.clear();
continue;
}
@@ -693,51 +697,49 @@ void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
auto payload = buffer.substr( msgstart, length );
buffer.erase( 0, msgstart + length );
if ( !payload.empty() ) {
try {
auto res = json::parse( payload );
int msgid = -1;
if ( res.contains( MEMBER_ID ) ) {
msgid = res[MEMBER_ID].get<int>();
} else {
processNotification( res );
continue;
}
if ( res.contains( MEMBER_METHOD ) ) {
processRequest( res );
continue;
}
Log::debug( "LSPClientServer::readStdOut server %s said: \n%s", mLSP.name.c_str(),
res.dump().c_str() );
auto it = mHandlers.find( msgid );
if ( it != mHandlers.end() ) {
const auto handler = *it;
mHandlers.erase( it );
auto& h = handler.second.first;
auto& eh = handler.second.second;
if ( res.contains( MEMBER_ERROR ) && eh ) {
eh( res[MEMBER_ERROR] );
} else {
h( res[MEMBER_RESULT] );
}
} else {
Log::debug( "LSPClientServer::readStdOut server %s unexpected reply id: %d",
mLSP.name.c_str(), msgid );
}
continue;
} catch ( const json::exception& e ) {
Log::debug(
"LSPClientServer::readStdOut server %s said: Coudln't parse json err: %s",
mLSP.name.c_str(), e.what() );
}
if ( payload.empty() ) {
Log::debug( "LSPClientServer::readStdOut server %s empty payload", mLSP.name.c_str() );
continue;
}
try {
auto res = json::parse( payload );
int msgid = -1;
if ( res.contains( MEMBER_ID ) ) {
msgid = res[MEMBER_ID].get<int>();
} else {
processNotification( res );
continue;
}
if ( res.contains( MEMBER_METHOD ) ) {
processRequest( res );
continue;
}
Log::debug( "LSPClientServer::readStdOut server %s said: \n%s", mLSP.name.c_str(),
res.dump().c_str() );
auto it = mHandlers.find( msgid );
if ( it != mHandlers.end() ) {
const auto handler = *it;
mHandlers.erase( it );
auto& h = handler.second.first;
auto& eh = handler.second.second;
if ( res.contains( MEMBER_ERROR ) && eh ) {
eh( res[MEMBER_ERROR] );
} else {
h( res[MEMBER_RESULT] );
}
} else {
Log::debug( "LSPClientServer::readStdOut server %s unexpected reply id: %d",
mLSP.name.c_str(), msgid );
}
} catch ( const json::exception& e ) {
Log::debug( "LSPClientServer::readStdOut server %s said: Coudln't parse json err: %s",
mLSP.name.c_str(), e.what() );
}
Log::debug( "LSPClientServer::readStdOut server %s said: \n%s", mLSP.name.c_str(),
payload.c_str() );
}
}
@@ -751,8 +753,8 @@ void LSPClientServer::readStdErr( const char* bytes, size_t n ) {
}
if ( !msg.message.empty() ) {
msg.type = LSPMessageType::Log;
Log::warning( "LSPClientServer::readStdOut server %s: %s", mLSP.name.c_str(),
msg.message.c_str() );
Log::debug( "LSPClientServer::readStdOut server %s: %s", mLSP.name.c_str(),
msg.message.c_str() );
}
}