File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 -DCMAKE_BUILD_TYPE=Release `
6464 -DCMAKE_PREFIX_PATH="$env:HIGHS_DIR" `
6565 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}\dist" `
66+ -DBUILD_SHARED_LIBS=OFF `
6667 -DJRES_VERSION="${{ inputs.version }}"
6768
6869 - name : Add Build Dir to PATH
@@ -121,15 +122,10 @@ jobs:
121122 Copy-Item "dist\bin\jres_solver.exe" -Destination "$pkg\bin\"
122123 Copy-Item "dist\bin\jres_formatter.exe" -Destination "$pkg\bin\"
123124
124- # Library (Handle DLLs and LIBs)
125- # Copy import libraries (.lib) to lib folder
125+ # Library (static)
126126 if (Test-Path "dist\lib\jres_solver.lib") {
127127 Copy-Item "dist\lib\jres_solver.lib" -Destination "$pkg\lib\"
128128 }
129- # Copy runtime libraries (.dll) to bin folder (typical windows convention)
130- if (Test-Path "dist\bin\jres_solver.dll") {
131- Copy-Item "dist\bin\jres_solver.dll" -Destination "$pkg\bin\"
132- }
133129
134130 # Specific Header
135131 Copy-Item "dist\include\jres_solver\jres_solver.hpp" -Destination "$pkg\include\jres_solver\"
Original file line number Diff line number Diff line change @@ -166,9 +166,11 @@ set_target_properties(jres_solver_lib PROPERTIES OUTPUT_NAME "jres_solver")
166166
167167if (WIN32 )
168168 target_sources (jres_solver_lib PRIVATE ${VERSION_RC} )
169- # Only export symbols if we are actually building shared
169+
170170 if (BUILD_SHARED_LIBS )
171171 target_compile_definitions (jres_solver_lib PRIVATE JRES_SOLVER_EXPORTS )
172+ else ()
173+ target_compile_definitions (jres_solver_lib PUBLIC JRES_STATIC )
172174 endif ()
173175endif ()
174176
Original file line number Diff line number Diff line change 1313#define JRES_SOLVER_HPP
1414
1515#if defined(_WIN32)
16- // Windows/MSVC: Use __declspec(dllexport/dllimport)
17- #ifdef JRES_SOLVER_EXPORTS
16+ // Windows/MSVC: Handle DLL exports, imports, AND static builds
17+ #if defined(JRES_STATIC)
18+ // Static build: No special attributes needed
19+ #define JRES_SOLVER_API
20+ #elif defined(JRES_SOLVER_EXPORTS)
21+ // Building the DLL: Export symbols
1822 #define JRES_SOLVER_API __declspec (dllexport)
1923 #else
24+ // Using the DLL: Import symbols
2025 #define JRES_SOLVER_API __declspec (dllimport)
2126 #endif
2227#else
You can’t perform that action at this time.
0 commit comments