Skip to content

Commit

Permalink
Merge pull request #41 from silicon-heaven/fix-wasm
Browse files Browse the repository at this point in the history
Fix wasm build
  • Loading branch information
fvacek authored Jan 29, 2024
2 parents d9b1dd4 + 796cc5a commit 1085eaa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/actions/run-linter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ runs:
modules: qtserialport qtwebsockets qtnetworkauth
additional_cmake_args: -DCMAKE_GLOBAL_AUTOGEN_TARGET=ON -DCMAKE_AUTOGEN_ORIGIN_DEPENDS=OFF

- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
if: runner.os == 'Linux'
with:
os: ubuntu-latest

- name: Build autogenerated stuff
shell: bash
run: cmake --build ${{github.workspace}}/build --parallel "$(nproc)" --target autogen
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Run clang-tidy
uses: ./.github/actions/run-linter
with:
lint_program_with_args: clang-tidy --quiet --warnings-as-errors=*
lint_program_with_args: clang-tidy-15 --quiet --warnings-as-errors=*

clazy:
name: clazy / Ubuntu 22.04
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif()

if(USE_QT6)
if(EMSCRIPTEN)
find_package(Qt6 COMPONENTS Core Widgets Gui Network NetworkAuth WebSockets)
find_package(Qt6 COMPONENTS Core Widgets Gui Network WebSockets)
else()
find_package(Qt6 COMPONENTS Core Widgets Gui Network NetworkAuth SerialPort WebSockets)
endif()
Expand Down
3 changes: 2 additions & 1 deletion shvspy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ qt_add_executable(shvspy
config/config.qrc
)

if(USE_QT6)
if(USE_QT6 AND NOT EMSCRIPTEN)
target_link_libraries(shvspy PRIVATE libshv::libshvvisu Qt::NetworkAuth)
target_compile_definitions(shvspy PRIVATE "WITH_AZURE_SUPPORT")
else()
target_link_libraries(shvspy PRIVATE libshv::libshvvisu)
endif()
Expand Down
8 changes: 4 additions & 4 deletions shvspy/src/servertreemodel/shvbrokernodeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <QMessageBox>
#include <QTimer>

#if QT_VERSION_MAJOR >= 6
#if QT_VERSION_MAJOR >= 6 && defined(WITH_AZURE_SUPPORT)
#include <QDesktopServices>
#include <QFuture>
#include <QOAuth2AuthorizationCodeFlow>
Expand Down Expand Up @@ -157,7 +157,7 @@ const std::string& ShvBrokerNodeItem::shvRoot() const
return m_shvRoot;
}

#if QT_VERSION_MAJOR >= 6
#if QT_VERSION_MAJOR >= 6 && defined(WITH_AZURE_SUPPORT)
namespace {
const auto AZURE_CLIENT_ID = "f6c73b47-914d-4232-bbe9-70495e48b314";
const auto AZURE_AUTH_URL = QUrl("https://login.microsoftonline.com/common/oauth2/v2.0/authorize");
Expand Down Expand Up @@ -273,7 +273,7 @@ void ShvBrokerNodeItem::open()
cli->setPassword(pwd);
//cli->setSkipLoginPhase(m_brokerPropeties.value("skipLoginPhase").toBool());

#if QT_VERSION_MAJOR >= 6
#if QT_VERSION_MAJOR >= 6 && defined(WITH_AZURE_SUPPORT)
bool azure_login = m_brokerPropeties.value(brokerProperty::AZURELOGIN, false).toBool();

if (azure_login) {
Expand Down Expand Up @@ -308,7 +308,7 @@ void ShvBrokerNodeItem::open()
#endif
cli->open();
emitDataChanged();
#if QT_VERSION_MAJOR >= 6
#if QT_VERSION_MAJOR >= 6 && defined(WITH_AZURE_SUPPORT)
}
#endif
}
Expand Down

0 comments on commit 1085eaa

Please sign in to comment.