Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit aee1cea
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:30:49 2023 -0500

    Update build.yml

commit e024cd6
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:29:24 2023 -0500

    Update build.yml

commit bda0f26
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:19:42 2023 -0500

    Update CMakeLists.txt

commit 1e1e77d
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:13:07 2023 -0500

    Update conanprofile-linux.txt

commit 486a3cc
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:10:59 2023 -0500

    Update build.yml

commit 68654ce
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:10:12 2023 -0500

    Update build.yml

commit 03f7abe
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:07:49 2023 -0500

    Specify Conan Profiles

commit cd10bab
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 22:00:25 2023 -0500

    Update CMakeLists.txt

commit 872cbdd
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:59:22 2023 -0500

    Update build.yml

commit b81b655
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:59:20 2023 -0500

    Update CMakeLists.txt

commit ad4a7d5
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:50:41 2023 -0500

    Update CMakeLists.txt

commit f7de399
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:45:08 2023 -0500

    Update build.yml

commit b82541d
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:41:47 2023 -0500

    Update build.yml

commit 56f45d4
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:39:23 2023 -0500

    Update userdirectories.cpp

commit 3218e83
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:35:32 2023 -0500

    Update build.yml

commit ae88f85
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:30:06 2023 -0500

    Update build.yml

commit 65fad75
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:25:06 2023 -0500

    Update build.yml

commit dedc6cd
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:18:33 2023 -0500

    Update build.yml

commit fbbb0b0
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:12:49 2023 -0500

    Update build.yml

commit 9b85575
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:05:06 2023 -0500

    Update build.yml

commit 000dce6
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 21:03:12 2023 -0500

    Update build.yml

commit fe8ad78
Author: Nick Logozzo <[email protected]>
Date:   Thu Nov 30 20:56:52 2023 -0500

    Update build.yml
  • Loading branch information
nlogozzo committed Dec 1, 2023
1 parent b9c2575 commit 541e47b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 26 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,28 @@ name: Build
permissions:
id-token: write
contents: read
env:
BUILD_TYPE: Release
jobs:
build:
name: "Build"
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- name: "Build on Linux"
os: ubuntu-latest
artifact: "Linux-x64.zip"
mode: "Release"
conan-install-cmd: conan install conanfile-linux.txt -s compiler.cppstd=20 --build missing
- os: windows-latest
conan-profile: conanprofile-linux.txt
conan-file: conanfile-linux.txt
env:
CC: gcc
CXX: g++
- name: "Build on Windows"
os: windows-latest
artifact: "Windows-x64.zip"
mode: "Release"
conan-install-cmd: conan install conanfile-windows.txt -s compiler.cppstd=20 --build missing
conan-profile: conanprofile-windows.txt
conan-file: conanfile-windows.txt
fail-fast: false
steps:
- name: "Checkout"
Expand All @@ -32,19 +39,25 @@ jobs:
submodules: recursive
- name: "Get Conan"
uses: turtlebrowser/get-conan@main
- name: "Create Conan Profile"
run: conan profile detect --force
- name: "Install Conan"
run: ${{ matrix.config.conan-install-cmd }}
- name: "CMake Load Cache"
working-directory: /build
run: cmake ..
- name: "CMake Build"
run: cmake --build . --config ${{ matrix.config.mode }}
run: conan install ${{matrix.config.conan-file}} --profile:host=${{matrix.config.conan-profile}} --profile:build=${{matrix.config.conan-profile}} -s compiler.cppstd=20 --build=missing
- name: "CMake Build (Linux)"
if: matrix.config.os == ubuntu-latest
working-directory: ${{github.workspace}}/build
run: |
cmake .. -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/build/Release/generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build .
- name: "CMake Build (Windows)"
if: matrix.config.os == windows-latest
working-directory: ${{github.workspace}}/build
run: |
cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/build/generators/conan_toolchain.cmake"
cmake --build . --config ${{env.BUILD_TYPE}}
- name: "CMake Install"
run: cmake --install build --prefix instdir --strip
working-directory: ${{github.workspace}}/build
run: cmake --install . --prefix "${{github.workspace}}/install"
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.config.artifact }}
name: ${{ matrix.config.artifact }}-${{ matrix.config.mode }}
path: ${{github.workspace}}/install
name: ${{matrix.config.artifact}}-${{env.BUILD_TYPE}}
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
cmake_minimum_required (VERSION 3.9)
cmake_minimum_required (VERSION 3.20)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("libaura" VERSION 2023.12.0 DESCRIPTION "A cross-platform base for native Nickvision applications.")
include(GNUInstallDirs)

Expand All @@ -27,23 +32,23 @@ add_library (${PROJECT_NAME} SHARED
src/version.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR})
SOVERSION ${PROJECT_VERSION})

#libaura Packages
find_package(Intl REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Intl::Intl)
find_package(jsoncpp CONFIG REQUIRED)
find_package(jsoncpp REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC JsonCpp::JsonCpp)
find_package(CURL REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC CURL::libcurl)
find_package(maddy CONFIG REQUIRED)
find_package(maddy REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC maddy::maddy)
find_package(sqlcipher CONFIG REQUIRED)
find_package(sqlcipher REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC sqlcipher::sqlcipher)
find_package(SQLiteCpp CONFIG REQUIRED)
find_package(SQLiteCpp REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC SQLiteCpp)
if(LINUX)
find_package(DBus1 CONFIG REQUIRED)
find_package(DBus1 REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC dbus-1)
endif()

Expand Down
8 changes: 8 additions & 0 deletions conanprofile-linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
9 changes: 9 additions & 0 deletions conanprofile-windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
2 changes: 1 addition & 1 deletion src/userdirectories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace Nickvision::Aura
std::filesystem::path result;
#ifndef _WIN32
result = getXDGDir("XDG_RUNTIME_DIR");
result = result.empty() ? ("/run/user/" / getenv("UID")) : result;
result = result.empty() ? (std::filesystem::path("/run/user/") / std::filesystem::path(getenv("UID"))) : result;
#endif
return result;
}
Expand Down

0 comments on commit 541e47b

Please sign in to comment.