Skip to content
Merged
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
40 changes: 24 additions & 16 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
build_type: [Release,Debug]
c_compiler: [gcc, clang, cl]
include:
Expand All @@ -29,20 +29,13 @@ jobs:
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc

steps:
- uses: actions/checkout@v4
Expand All @@ -51,20 +44,35 @@ jobs:
id: strings
shell: bash
run: |
echo "test-build-output-dir=${{ github.workspace }}/test-build" >> "$GITHUB_OUTPUT"
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure CMake
- name: Install dependencies (linux)
if: matrix.os == 'ubuntu-latest'
run: >
cmake -B ${{ steps.strings.outputs.test-build-output-dir }}
sudo apt install -y libjpeg8-dev libpng-dev libasound2-dev
alsa-utils alsa-oss libx11-dev libxft-dev libxcursor-dev

- name: Configure CMake (gui)
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DNSTALL_CLI_ONLY=ON
-S ${{ github.workspace }}

- name: Build for tests
run: cmake --build ${{ steps.strings.outputs.test-build-output-dir }} --config ${{ matrix.build_type }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ steps.strings.outputs.test-build-output-dir }}/tests
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure
uses: coactions/setup-xvfb@v1
with:
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure
working-directory: ${{ steps.strings.outputs.build-output-dir }}/tests

- name: Create build artifact
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: build-out-${{ matrix.os }}-${{ matrix.c_compiler }}
path: ${{ steps.strings.outputs.build-output-dir }}
retention-days: 5
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ build
*.profraw
.cache
compile_commands.json
.vs
CMakeSettings.json
out

# testing binaries
*_Installer
*_Installer*
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ if(NOT NSTALL_CLI_ONLY)
message(STATUS "Fetching dependency: nana")
FetchContent_Declare(
nana
GIT_REPOSITORY https://github.com/cnjinhao/nana
GIT_TAG 96d48b8413866028f5d284ee55b763ceab7aeb1f)
GIT_REPOSITORY https://github.com/niten01/nana
GIT_TAG 4bbf352bebbf912983319c3d784a9b38aad828fd)
FetchContent_MakeAvailable(nana)
set_target_properties(nana PROPERTIES CXX_STANDARD 17)
target_link_libraries(${COMMON_TARGET} PUBLIC nana)
Expand Down
4 changes: 2 additions & 2 deletions src/Constructor/ConstructorForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ void ConstructorForm::onMainClick() {
fs::path directory{ directoryTextBox_.text() };

nana::filebox fb{ *this, false };
fb.init_file(fs::current_path() /
(programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION));
fb.init_file((fs::current_path() /
(programNameSafe + "_Installer" + NSTALL_EXE_EXTENSION)).string());
fb.add_filter("Executable", "*." NSTALL_EXE_EXTENSION);
fb.allow_multi_select(false);
auto paths{ fb.show() };
Expand Down
2 changes: 2 additions & 0 deletions src/Constructor/ConstructorMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <iostream>
#ifndef NSTALL_CLI_ONLY
#include "nstall/Constructor/ConstructorForm.hpp"
#define FORCE_CLI false
Expand Down Expand Up @@ -35,6 +36,7 @@ auto main(int argc, char* argv[]) -> int {
nstall::ConstructorForm constructor{ resourcesDir };
constructor.run();
} catch (const nstall::ConstructorFormException& e) {
std::cerr << e.what() << std::endl;
nana::msgbox err{ "Error" };
err.icon(nana::msgbox::icon_error);
err << e.what();
Expand Down
2 changes: 1 addition & 1 deletion src/Installer/InstallerForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void InstallerForm::createForm() {
title_.text_align(nana::align::center);
title_.typeface(nana::paint::font{
styler.font(), 20, nana::paint::font::font_style{ 500 } });
title_.caption(metaInfo_->programName());
title_.caption(metaInfo_->programName() + " Installer");
styler.stylize(title_);
mainLayout_["title"] << title_;

Expand Down
2 changes: 2 additions & 0 deletions src/Installer/InstallerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cxxopts.hpp>
#include <filesystem>
#include <fmt/color.h>
#include <iostream>

auto main(int argc, char** argv) -> int {

Expand All @@ -28,6 +29,7 @@ auto main(int argc, char** argv) -> int {
nstall::InstallerForm installer{ argv[0] };
installer.run();
} catch (const nstall::InstallerFormException& e) {
std::cerr << e.what() << std::endl;
nana::msgbox err{ "Error" };
err.icon(nana::msgbox::icon_error);
err << e.what();
Expand Down