Skip to content

Commit 8093367

Browse files
committed
Added msi build
1 parent 7af5990 commit 8093367

File tree

16 files changed

+190
-79
lines changed

16 files changed

+190
-79
lines changed

.github/actions/conan_build/action.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: conan-profile
66
required: true
77
default: default
8+
args:
9+
description: conan build apponly option
10+
required: false
11+
default: ""
812

913
runs:
1014
using: composite
@@ -23,4 +27,4 @@ runs:
2327

2428
- name: Conan build
2529
shell: bash
26-
run: conan build . --profile:build=${{inputs.profile}} --profile:host=${{inputs.profile}} --build=missing --output-folder=.
30+
run: conan build . --profile:build=${{inputs.profile}} --profile:host=${{inputs.profile}} --build=missing --output-folder=. ${{inputs.args}

.github/actions/enable_conan/action.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ inputs:
55
description: conan-profile
66
required: true
77
default: default
8+
args:
9+
description: conan build apponly option
10+
required: false
11+
default: ""
812

913
runs:
1014
using: composite
@@ -25,5 +29,5 @@ runs:
2529
shell: bash
2630
run: |
2731
conan config install CI/conan
28-
conan install . --build=missing --profile:build=${{inputs.profile}} --profile:host=${{inputs.profile}} --output-folder=.
32+
conan install . --build=missing --profile:build=${{inputs.profile}} --profile:host=${{inputs.profile}} --output-folder=. ${{inputs.args}
2933
conan cache clean "*" --source --build --temp --download

.github/workflows/build.yaml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
default: win-msvc194_x64
1515
type: string
1616

17+
win_x64_apponly_profile:
18+
description: profile for win x64
19+
required: true
20+
default: win-msvc194_x64_static
21+
type: string
22+
1723
macos_arm_profile:
1824
description: profile for macos arm
1925
required: true
@@ -38,6 +44,7 @@ jobs:
3844
with:
3945
linux_x64_profile: ${{inputs.linux_x64_profile}}
4046
win_x64_profile: ${{inputs.win_x64_profile}}
47+
win_x64_apponly_profile: ${{inputs.win_x64_apponly_profile}}
4148
macos_arm_profile: ${{inputs.macos_arm_profile}}
4249
macos_x64_profile: ${{inputs.macos_x64_profile}}
4350

@@ -137,8 +144,6 @@ jobs:
137144
needs: [cache]
138145
permissions:
139146
id-token: write
140-
contents: read
141-
checks: write
142147
attestations: write
143148
steps:
144149
- uses: actions/checkout@v4
@@ -161,3 +166,34 @@ jobs:
161166
builddir: build
162167
artifact: ${{inputs.win_x64_profile}}
163168
attestation: ${{inputs.sign != ''}}
169+
170+
win-x64-apponly-build:
171+
runs-on: windows-2022
172+
needs: [cache]
173+
permissions:
174+
id-token: write
175+
contents: read
176+
checks: write
177+
attestations: write
178+
steps:
179+
- uses: actions/checkout@v4
180+
with:
181+
fetch-depth: 0
182+
183+
- uses: ./.github/actions/enable_python
184+
- uses: ./.github/actions/conan_build
185+
with:
186+
profile: ${{inputs.win_x64_apponly_profile}}
187+
args: -o daggy/*:apponly=True
188+
189+
- uses: ./.github/actions/tests
190+
with:
191+
testdir: build
192+
name: ${{inputs.win_x64_profile}} tests
193+
194+
- uses: ./.github/actions/deploy
195+
if: inputs.sign != 'none'
196+
with:
197+
builddir: build
198+
artifact: ${{inputs.win_x64_apponly_profile}}
199+
attestation: ${{inputs.sign != ''}}

.github/workflows/check_cache.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
default: win-msvc194_x64
1515
type: string
1616

17+
win_x64_apponly_profile:
18+
description: profile for win x64 static
19+
required: true
20+
default: win-msvc194_x64_static
21+
type: string
22+
1723
macos_arm_profile:
1824
description: profile for macos arm
1925
required: true
@@ -35,6 +41,8 @@ on:
3541
value: ${{jobs.macos-x64-check-cache.outputs.exists}}
3642
win_x64_hit:
3743
value: ${{jobs.win-x64-check-cache.outputs.exists}}
44+
win_x64_apponly_hit:
45+
value: ${{jobs.win-x64-apponly-check-cache.outputs.exists}}
3846

3947
jobs:
4048
linux-x64-check-cache:
@@ -81,4 +89,15 @@ jobs:
8189
with:
8290
profile: ${{inputs.win_x64_profile}}
8391

92+
win-x64-apponly-check-cache:
93+
runs-on: windows-2022
94+
outputs:
95+
exists: ${{steps.check-cache.outputs.exists}}
96+
steps:
97+
- uses: actions/checkout@v4
98+
- uses: ./.github/actions/check_cache
99+
id: check-cache
100+
with:
101+
profile: ${{inputs.win_x64_apponly_profile}}
102+
84103

.github/workflows/make_cache.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ on:
1414
default: win-msvc194_x64
1515
type: string
1616

17+
win_x64_apponly_profile:
18+
description: profile for win x64 static build
19+
required: true
20+
default: win-msvc194_x64_static
21+
type: string
22+
23+
1724
macos_arm_profile:
1825
description: profile for macos arm
1926
required: true
@@ -32,13 +39,14 @@ jobs:
3239
with:
3340
linux_x64_profile: ${{inputs.linux_x64_profile}}
3441
win_x64_profile: ${{inputs.win_x64_profile}}
42+
win_x64_apponly_profile: ${{inputs.win_x64_apponly_profile}}
3543
macos_arm_profile: ${{inputs.macos_arm_profile}}
3644
macos_x64_profile: ${{inputs.macos_x64_profile}}
3745

3846
linux-x64-make-cache:
3947
runs-on: ubuntu-22.04
4048
needs: [check-cache]
41-
if: ${{needs.check-cache.outputs.linux_x64_hit != 'true'}}
49+
if: !needs.check-cache.outputs.linux_x64_hit
4250
steps:
4351
- uses: actions/checkout@v4
4452
- uses: ./.github/actions/setup_ubuntu_env
@@ -50,7 +58,7 @@ jobs:
5058
macos-arm-make-cache:
5159
runs-on: macos-14
5260
needs: [check-cache]
53-
if: ${{needs.check-cache.outputs.macos_arm_hit != 'true'}}
61+
if: !needs.check-cache.outputs.macos_arm_hit
5462
steps:
5563
- uses: actions/checkout@v4
5664
- uses: ./.github/actions/enable_python_macos
@@ -61,7 +69,7 @@ jobs:
6169
macos-x64-make-cache:
6270
runs-on: macos-13
6371
needs: [check-cache]
64-
if: ${{needs.check-cache.outputs.macos_x64_hit != 'true'}}
72+
if: !needs.check-cache.outputs.macos_x64_hit
6573
steps:
6674
- uses: actions/checkout@v4
6775
- uses: ./.github/actions/enable_python_macos
@@ -72,12 +80,24 @@ jobs:
7280
win-x64-make-cache:
7381
runs-on: windows-2022
7482
needs: [check-cache]
75-
if: ${{needs.check-cache.outputs.win_x64_hit != 'true'}}
83+
if: !needs.check-cache.outputs.win_x64_hit
7684
steps:
7785
- uses: actions/checkout@v4
7886
- uses: ./.github/actions/enable_python
7987
- uses: ./.github/actions/enable_conan
8088
with:
8189
profile: ${{inputs.win_x64_profile}}
8290

91+
win-x64-apponly-make-cache:
92+
runs-on: windows-2022
93+
needs: [check-cache]
94+
if: !needs.check-cache.outputs.win_x64_apponly_hit
95+
steps:
96+
- uses: actions/checkout@v4
97+
- uses: ./.github/actions/enable_python
98+
- uses: ./.github/actions/enable_conan
99+
with:
100+
profile: ${{inputs.win_x64_apponly_profile}}
101+
args: -o daggy/*:apponly=True
102+
83103

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include(win-msvc194_x64)
2+
3+
[settings]
4+
compiler.runtime=static
5+
6+
[tool_requires]
7+
!cmake/*: cmake/[>=3 <4]
8+
9+
[options]
10+
*:shared=False

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 synacker
3+
Copyright (c) 2025 synacker
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

conanfile.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,42 @@ class DaggyConan(ConanFile):
3737
description = "Data Aggregation Utility and C/C++ developer library for data streams catching."
3838
settings = "os", "compiler", "build_type", "arch"
3939
options = {
40+
"apponly": [True, False],
4041
"shared": [True, False],
4142
"fPIC": [True, False]
4243
}
4344
default_options = {
45+
"apponly": False,
4446
"shared": True,
45-
"fPIC": False
47+
"fPIC": True
4648
}
4749
generators = "CMakeDeps"
4850
exports = ["git_version.py", "src/*"]
4951

50-
51-
_cmake = None
52-
5352
def set_version(self):
5453
self.version = GitVersion().version
5554

5655
def validate(self):
5756
check_min_cppstd(self, "17")
5857

5958
def config_options(self):
60-
if not self.options.shared:
61-
self.options.fPIC = True
62-
6359
if self.settings.os == "Windows":
6460
del self.options.fPIC
6561

66-
self.options["qt"].shared = self.options.shared
67-
self.options["libssh2"].shared = self.options.shared
68-
self.options["yaml-cpp"].shared = self.options.shared
62+
if self.options.apponly:
63+
self.options.shared = False
64+
65+
self.options["qt/*"].shared = self.options.shared
66+
self.options["libssh2/*"].shared = self.options.shared
67+
self.options["yaml-cpp/*"].shared = self.options.shared
68+
69+
def configure(self):
70+
if self.options.shared:
71+
self.options.rm_safe("fPIC")
72+
73+
if self.options.apponly:
74+
self.options.rm_safe("shared")
75+
6976

7077
def build_requirements(self):
7178
self.tool_requires("cmake/3.30.1")
@@ -107,17 +114,14 @@ def generate(self):
107114
tc.cache_variables["SSH2_SUPPORT"] = True
108115
tc.cache_variables["YAML_SUPPORT"] = True
109116
tc.cache_variables["CONSOLE"] = True
117+
tc.cache_variables["APPONLY_BUILD"] = self.options.apponly
110118
tc.cache_variables["PCAPNG_SUPPORT"] = False
111-
tc.cache_variables["PORTABLE_BUILD"] = True
119+
tc.cache_variables["PORTABLE_BUILD"] = not self.options.apponly
112120
tc.cache_variables["BUILD_TESTING"] = True
113121
tc.cache_variables["CONAN_BUILD"] = True
114122
tc.cache_variables["VERSION"] = GitVersion().version
115123
tc.cache_variables["VERSION_EXTENDED"] = GitVersion().extended
116124

117-
if self.options.shared:
118-
tc.cache_variables["CMAKE_C_VISIBILITY_PRESET"] = "hidden"
119-
tc.cache_variables["CMAKE_CXX_VISIBILITY_PRESET"] = "hidden"
120-
tc.cache_variables["CMAKE_VISIBILITY_INLINES_HIDDEN"] = 1
121125
tc.generate()
122126

123127
def build(self):

src/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.24)
22

3-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
3+
set(CMAKE_PROJECT_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
4+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_PROJECT_MODULES})
45

56
include(version)
67
SET_VERSION()
@@ -16,7 +17,7 @@ set(CMAKE_BINARY_EXPORTS_DIR ${CMAKE_BINARY_DIR}/exports/)
1617
include_directories(${CMAKE_BINARY_EXPORTS_DIR})
1718

1819
set(PROJECT_VENDOR synacker)
19-
set(PROJECT_COPYRIGTH "Copyright \\251 2025 Mikhail Milovidov. Some Rights Reserved")
20+
set(PROJECT_COPYRIGTH "Copyright \\251 2025 synacker. Some Rights Reserved")
2021

2122
option(PORTABLE_BUILD "portable install packages" OFF)
2223
option(APPONLY_BUILD "build only application with static deps linkage" OFF)
@@ -28,6 +29,8 @@ option(CONSOLE "daggy console application" ON)
2829

2930
if (APPONLY_BUILD)
3031
set(BUILD_SHARED_LIBS OFF)
32+
set(CONAN_BUILD ON)
33+
set(PORTABLE_BUILD OFF)
3134
set(CONSOLE ON)
3235
endif()
3336

@@ -40,6 +43,10 @@ if(SSH2_SUPPORT)
4043
add_definitions(-DSSH2_SUPPORT)
4144
endif()
4245

46+
if(CONAN_BUILD)
47+
add_definitions(-DCONAN_BUILD)
48+
endif()
49+
4350
if(YAML_SUPPORT)
4451
add_definitions(-DYAML_SUPPORT)
4552
endif()

src/Daggy/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ find_package(Qt6 COMPONENTS Core REQUIRED)
77
add_executable(${TARGET})
88
include(rpath_bin)
99
set_target_properties(${TARGET} PROPERTIES AUTOMOC ON)
10+
include(versionmeta)
1011

1112
target_sources(${TARGET}
1213
PRIVATE

src/DaggyCore/CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ add_library(${TARGET})
55
include(rpath_lib)
66
set_target_properties(${TARGET} PROPERTIES AUTOMOC ON)
77

8+
if (BUILD_SHARED_LIBS)
9+
include(versionmeta)
10+
endif()
11+
812
target_sources(${TARGET}
913
PRIVATE
1014
Core.cpp
@@ -103,14 +107,17 @@ if (BUILD_TESTING)
103107
add_subdirectory(tests/interface)
104108
endif()
105109

106-
if(UNIX)
107-
install(TARGETS ${TARGET} LIBRARY)
108-
else()
109-
install(TARGETS ${TARGET} ARCHIVE)
110+
if(NOT APPONLY_BUILD)
111+
if(UNIX)
112+
install(TARGETS ${TARGET} LIBRARY)
113+
else()
114+
install(TARGETS ${TARGET} ARCHIVE)
115+
endif()
116+
110117
if (BUILD_SHARED_LIBS)
111118
install(TARGETS ${TARGET} RUNTIME)
112119
endif()
113-
endif()
114120

115-
install(TARGETS ${TARGET} FILE_SET HEADERS)
116-
include(package_deps)
121+
install(TARGETS ${TARGET} FILE_SET HEADERS)
122+
include(package_deps)
123+
endif()

src/LICENSE renamed to src/LICENSE.rtf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Milovidov Mikhail
3+
Copyright (c) 2025 synacker
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)