Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
compiler: 'gcc'
- os: macos-latest
compiler: 'msvc'
- os: windows-2022
compiler: 'clang'
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -119,6 +117,16 @@ jobs:
cache: true
modules: 'qtwebsockets qtmultimedia'
tools: 'tools_mingw1310'
- if: runner.os == 'Windows' && matrix.compiler == 'clang'
name: Install Qt for Windows (LLVM-MinGW)
uses: jurplel/install-qt-action@v4
with:
version: '6.8.3'
dir: 'C:\'
arch: win64_llvm_mingw
cache: true
modules: 'qtwebsockets qtmultimedia'
tools: 'tools_llvm_mingw1706'

#
# Build
Expand All @@ -135,9 +143,22 @@ jobs:
echo "C:/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "C:\Qt\Tools\mingw1310_64\bin;$env:PATH"
}
if ('${{ matrix.compiler }}' -eq 'clang') {
$llvmDir = Get-ChildItem -Path "C:\Qt\Tools" -Filter "llvm-mingw*" -Directory | Sort-Object Name -Descending | Select-Object -First 1
if ($null -ne $llvmDir) {
$llvmBin = Join-Path $llvmDir.FullName "bin"
echo "$($llvmBin.Replace('\', '/'))" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$llvmBin;$env:PATH"
$env:CC = Join-Path $llvmBin "clang.exe"
$env:CXX = Join-Path $llvmBin "clang++.exe"
} else {
Write-Error "LLVM-MinGW toolchain not found"
exit 1
}
}
$packageDir = ($env:GITHUB_WORKSPACE -replace '\\', '/') + "/artifact"
$launcher = ${{ matrix.compiler == 'msvc' && 'sccache' || 'ccache' }}
cmake -DCMAKE_BUILD_TYPE=Debug -G 'Ninja' -DWITH_MAP=OFF -DCPACK_PACKAGE_DIRECTORY="$packageDir" -DCMAKE_PREFIX_PATH=$env:QT_ROOT_DIR -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DPACKAGE_TYPE=Nsis -DCMAKE_C_COMPILER_LAUNCHER="$launcher" -DCMAKE_CXX_COMPILER_LAUNCHER="$launcher" -S .. || exit -1
cmake -DCMAKE_BUILD_TYPE=Debug -G 'Ninja' -DWITH_MAP=OFF -DCPACK_PACKAGE_DIRECTORY="$packageDir" -DCMAKE_PREFIX_PATH=$env:QT_ROOT_DIR -DWITH_WEBSOCKET=ON -DWITH_QTKEYCHAIN=ON -DPACKAGE_TYPE=Nsis -DCMAKE_C_COMPILER_LAUNCHER="$launcher" -DCMAKE_CXX_COMPILER_LAUNCHER="$launcher" -S .. || exit 1
cmake --build . --parallel
- if: runner.os == 'Linux' || runner.os == 'macOS'
name: Build MMapper for Linux and Mac
Expand Down
34 changes: 25 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)

message(STATUS "Building with GCC undefined behavior sanitizer")
message(STATUS "Building with GCC undefined behavior sanitizer")
add_compile_options(-fsanitize=undefined)
add_link_options(-fsanitize=undefined)
endif()
Expand Down Expand Up @@ -397,14 +397,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

if(MMAPPER_IS_DEBUG)
if(NOT WIN32)
# segfaults in ASAN initializer on 32-bit Ubuntu 18.04.1 with clang 6.0
# note: apparently -fsanitize=address can't be used with gnu libc 2.25+
# Ubuntu 18.04.1 has libc 2.27.
message(STATUS "Building with Clang address sanitizer")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
# segfaults in ASAN initializer on 32-bit Ubuntu 18.04.1 with clang 6.0
# note: apparently -fsanitize=address can't be used with gnu libc 2.25+
# Ubuntu 18.04.1 has libc 2.27.
message(STATUS "Building with Clang address sanitizer")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)

if(TRUE)
message(STATUS "Building with Clang undefined behavior sanitizer")
Expand Down Expand Up @@ -474,6 +472,24 @@ if(MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/utf-8)
add_compile_options(/permissive-)

if(MMAPPER_IS_DEBUG)
message(STATUS "Building with MSVC address sanitizer")
add_compile_options(/fsanitize=address)
add_compile_options(/Oy-) # Disable frame-pointer omission

# ASAN is incompatible with /RTC (Runtime Checks)
# CMake defaults to /RTC1 for Debug builds. We need to remove it.
string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")

# Linker flags for ASAN
add_link_options(/fsanitize=address)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
endif()

if(CMAKE_BUILD_TYPE_UPPER MATCHES "^RELWITHDEBINFO$")
# improve performance
string(REPLACE "/Ob1" "/Ob2" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
Expand Down
4 changes: 2 additions & 2 deletions external/qtkeychain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ else()
endif()

ExternalProject_Add(qtkeychain_repo
GIT_REPOSITORY "https://github.com/nschimme/qtkeychain.git"
GIT_TAG "wasm"
GIT_REPOSITORY "https://github.com/frankosterfeld/qtkeychain.git"
GIT_TAG "708d09927d52743c801c1a974d432f19266f2fb1"

SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtkeychain-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtkeychain-build"
Expand Down
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ set(mmapper_SRCS
preferences/generalpage.h
preferences/graphicspage.cpp
preferences/graphicspage.h
preferences/hotkeypage.cpp
preferences/hotkeypage.h
preferences/grouppage.cpp
preferences/grouppage.h
preferences/mumeprotocolpage.cpp
Expand Down Expand Up @@ -671,6 +673,7 @@ set(mmapper_UIS
preferences/clientpage.ui
preferences/generalpage.ui
preferences/graphicspage.ui
preferences/hotkeypage.ui
preferences/grouppage.ui
preferences/mumeprotocolpage.ui
preferences/ManagePasswordDialog.ui
Expand Down Expand Up @@ -1147,7 +1150,10 @@ if(WIN32)
endif()

# Bundle Library Files
set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --compiler-runtime --no-translations --no-system-d3d-compiler --no-opengl-sw --verbose 1)
set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --no-translations --no-system-d3d-compiler --no-opengl-sw --verbose 1)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} --compiler-runtime)
endif()
find_program(WINDEPLOYQT_APP windeployqt HINTS ${QTDIR} ENV QTDIR PATH_SUFFIXES .)
message(" - windeployqt path: ${WINDEPLOYQT_APP}")
message(" - windeployqt args: ${WINDEPLOYQT_ARGS}")
Expand Down
4 changes: 4 additions & 0 deletions src/preferences/configdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "generalpage.h"
#include "graphicspage.h"
#include "grouppage.h"
#include "hotkeypage.h"
#include "mumeprotocolpage.h"
#include "parserpage.h"
#include "pathmachinepage.h"
Expand Down Expand Up @@ -54,6 +55,7 @@ ConfigDialog::ConfigDialog(QWidget *const parent)
auto graphicsPage = new GraphicsPage(this);
auto parserPage = new ParserPage(this);
auto clientPage = new ClientPage(this);
auto hotkeyPage = new HotkeyPage(this);
auto groupPage = new GroupPage(this);
auto autoLogPage = new AutoLogPage(this);
auto audioPage = new AudioPage(this);
Expand Down Expand Up @@ -100,6 +102,7 @@ ConfigDialog::ConfigDialog(QWidget *const parent)
addPage(graphicsPage, tr("Graphics"), ":/icons/graphicscfg.png");
addPage(parserPage, tr("Parser"), ":/icons/parsercfg.png");
addPage(clientPage, tr("Integrated Client"), ":/icons/terminal.png");
addPage(hotkeyPage, tr("Hotkeys"), ":/icons/hotkeys.png");
addPage(groupPage, tr("Group Panel"), ":/icons/group-recolor.png");
addPage(autoLogPage, tr("Auto Logger"), ":/icons/autologgercfg.png");
addPage(audioPage, tr("Audio"), ":/icons/audiocfg.png");
Expand Down Expand Up @@ -147,6 +150,7 @@ ConfigDialog::ConfigDialog(QWidget *const parent)
connect(this, &ConfigDialog::sig_loadConfig, graphicsPage, &GraphicsPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, parserPage, &ParserPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, clientPage, &ClientPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, hotkeyPage, &HotkeyPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, autoLogPage, &AutoLogPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, audioPage, &AudioPage::slot_loadConfig);
connect(this, &ConfigDialog::sig_loadConfig, groupPage, &GroupPage::slot_loadConfig);
Expand Down
Loading