Skip to content
Merged
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
3 changes: 2 additions & 1 deletion scripts/Build-QuantLibDLL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Upstream QuantLib blocks DLL builds on MSVC with a FATAL_ERROR. This script
applies five patches to enable DLL builds:
1. cmake/Platform.cmake - Remove FATAL_ERROR blocking DLL builds
and suppress C4251 warnings
2. ql/CMakeLists.txt - Add RUNTIME DESTINATION for DLL install
3. ql/qldefines.hpp.cfg - Inject QL_EXPORT/QL_IMPORT_ONLY macros
4. normaldistribution.hpp - Annotate classes with QL_EXPORT
Expand Down Expand Up @@ -113,7 +114,7 @@ $PlatformCmake = "$QLSrcDir\cmake\Platform.cmake"
$original = Get-Content $PlatformCmake -Raw
$patched = $original -replace `
'message\(FATAL_ERROR\s*\r?\n\s*"Shared library \(DLL\) builds for QuantLib on MSVC are not supported"\)', `
'# Patched: DLL build enabled (FATAL_ERROR removed by QuantLib-DLL)'
"# Patched: DLL build enabled (FATAL_ERROR removed by QuantLib-DLL)`nadd_compile_options(/wd4251) # Suppress C4251: STL types in DLL-exported class members"
if ($patched -eq $original) {
Write-Warning "Platform.cmake patch pattern did not match - file may have changed or already patched"
Select-String -Path $PlatformCmake -Pattern "FATAL_ERROR|BUILD_SHARED|EXPORT_ALL|Patched" | Write-Host
Expand Down
Loading