Skip to content

Commit 7e9e64e

Browse files
committed
Fix artifact size with monolithic build & add installer generation
1 parent 02087b7 commit 7e9e64e

2 files changed

Lines changed: 37 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,22 @@ jobs:
8181
shell: bash
8282
run: |
8383
mv "${{ matrix.binary_path }}" ${{ matrix.asset_name }}
84+
85+
- name: Build Installer (Windows)
86+
if: matrix.os == 'windows-latest'
87+
shell: cmd
88+
run: |
89+
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" setup.iss
90+
dir build
91+
8492
8593
- name: Upload Artifact
8694
uses: actions/upload-artifact@v4
8795
with:
8896
name: ${{ matrix.asset_name }}
89-
path: ${{ matrix.asset_name }}
97+
path: |
98+
${{ matrix.asset_name }}
99+
build/ProXPL_Installer_*.exe
90100
91101
release:
92102
name: Create Release
@@ -97,6 +107,14 @@ jobs:
97107
uses: actions/download-artifact@v4
98108
with:
99109
name: proxpl-windows.exe
110+
111+
- name: Download Windows Installer
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: proxpl-windows.exe
115+
path: .
116+
pattern: ProXPL_Installer_*.exe
117+
merge-multiple: true
100118

101119
- name: Download Linux Artifact
102120
uses: actions/download-artifact@v4
@@ -113,6 +131,7 @@ jobs:
113131
with:
114132
files: |
115133
proxpl-windows.exe
134+
ProXPL_Installer_*.exe
116135
proxpl-linux
117136
proxpl-macos
118137
generate_release_notes: true

CMakeLists.txt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,39 @@ if (NOT LLVM_FOUND)
5353
endif()
5454

5555

56+
# --- Build Configuration ---
5657
# --- Build Configuration ---
5758
option(PROX_STATIC_BUILD "Build as a single static executable" ON)
5859

5960
if (PROX_STATIC_BUILD)
60-
set(LIB_TYPE STATIC)
6161
add_definitions(-DPROX_STATIC)
62+
63+
# Configure Static CRT for MSVC to avoid DLL dependencies
64+
if(MSVC)
65+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
66+
add_compile_options($<$<CONFIG:Release>:/MT> $<$<CONFIG:Debug>:/MTd>)
67+
endif()
68+
69+
# Monolithic build: Sources directly in executable to ensure all symbols are included
70+
add_executable(proxpl src/main.c ${LIB_SOURCES})
6271
else()
63-
set(LIB_TYPE SHARED)
72+
# Traditional split build
73+
add_library(proxpl_lib SHARED ${LIB_SOURCES})
74+
add_executable(proxpl src/main.c)
75+
target_link_libraries(proxpl PRIVATE proxpl_lib)
6476
endif()
6577

66-
# --- Core Library ---
67-
add_library(proxpl_lib ${LIB_TYPE} ${LIB_SOURCES})
78+
# --- Main Executable Linking ---
79+
# (Common linking logic)
6880
if (LLVM_FOUND)
69-
target_link_libraries(proxpl_lib PRIVATE ${llvm_libs})
81+
target_link_libraries(proxpl PRIVATE ${llvm_libs})
7082
endif()
7183

72-
# --- Main Executable ---
73-
add_executable(proxpl src/main.c)
74-
target_link_libraries(proxpl PRIVATE proxpl_lib ${llvm_libs})
75-
7684
if(UNIX)
7785
if(APPLE)
7886
target_link_libraries(proxpl PRIVATE pthread dl z)
79-
target_link_libraries(proxpl_lib PRIVATE pthread dl z)
8087
else()
8188
target_link_libraries(proxpl PRIVATE pthread dl z tinfo)
82-
target_link_libraries(proxpl_lib PRIVATE pthread dl z tinfo)
8389
endif()
8490
endif()
8591

0 commit comments

Comments
 (0)