From 8dd3d745916936fc87df55e7eff1ca149a7afcc5 Mon Sep 17 00:00:00 2001 From: ThomasDuquette <133025159+ThomasDuquette@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:03:21 -0300 Subject: [PATCH 1/3] Bug fix --- blast/CMakeLists.txt | 12 ++++++++++++ cmake/BlastConfig.cmake.in | 23 ++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/blast/CMakeLists.txt b/blast/CMakeLists.txt index ab24430..a4e1322 100644 --- a/blast/CMakeLists.txt +++ b/blast/CMakeLists.txt @@ -64,6 +64,18 @@ target_compile_features(blast INTERFACE cxx_std_17) target_link_libraries(blast INTERFACE nlopt) +# Tell CMake that nlopt's DLL is a runtime requirement of blast. +# Any executable that links blast (directly or transitively) and uses +# $ will automatically get nlopt.dll. +set_target_properties(nlopt PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + +# Propagate nlopt as a runtime DLL dependency through blast's INTERFACE +target_sources(blast INTERFACE + $ +) + # Tracy: propagate the correct macro to all consumers of blast. # TRACY_ENABLE is Tracy's own compile-time switch (checked in blast/blast). # Do NOT use add_compile_definitions — that would leak to every target. diff --git a/cmake/BlastConfig.cmake.in b/cmake/BlastConfig.cmake.in index 44d8f19..cd99b6a 100644 --- a/cmake/BlastConfig.cmake.in +++ b/cmake/BlastConfig.cmake.in @@ -2,4 +2,25 @@ include("${CMAKE_CURRENT_LIST_DIR}/BlastTargets.cmake") -check_required_components(Blast) \ No newline at end of file +check_required_components(Blast) + +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/BlastTargets.cmake") + +check_required_components(Blast) + +# --------------------------------------------------------------------------- +# Helper: call blast_copy_runtime_dlls(your_target) after find_package(Blast) +# to automatically copy nlopt.dll next to your executable on Windows. +# --------------------------------------------------------------------------- +macro(blast_copy_runtime_dlls target) + if(WIN32) + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ + $ + COMMENT "Copying nlopt.dll for ${target}" + ) + endif() +endmacro() \ No newline at end of file From a74373791b00dd6e03619ed2fc554997f1e2ff23 Mon Sep 17 00:00:00 2001 From: ThomasDuquette <133025159+ThomasDuquette@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:36:35 -0300 Subject: [PATCH 2/3] bug fix --- blast/CMakeLists.txt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/blast/CMakeLists.txt b/blast/CMakeLists.txt index a4e1322..ab24430 100644 --- a/blast/CMakeLists.txt +++ b/blast/CMakeLists.txt @@ -64,18 +64,6 @@ target_compile_features(blast INTERFACE cxx_std_17) target_link_libraries(blast INTERFACE nlopt) -# Tell CMake that nlopt's DLL is a runtime requirement of blast. -# Any executable that links blast (directly or transitively) and uses -# $ will automatically get nlopt.dll. -set_target_properties(nlopt PROPERTIES - WINDOWS_EXPORT_ALL_SYMBOLS ON -) - -# Propagate nlopt as a runtime DLL dependency through blast's INTERFACE -target_sources(blast INTERFACE - $ -) - # Tracy: propagate the correct macro to all consumers of blast. # TRACY_ENABLE is Tracy's own compile-time switch (checked in blast/blast). # Do NOT use add_compile_definitions — that would leak to every target. From dce7864a6c7f3621cf106386087f3701a3f8caba Mon Sep 17 00:00:00 2001 From: ThomasDuquette <133025159+ThomasDuquette@users.noreply.github.com> Date: Tue, 2 Jun 2026 12:09:52 -0300 Subject: [PATCH 3/3] bug fix --- blast/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/blast/CMakeLists.txt b/blast/CMakeLists.txt index ab24430..435993a 100644 --- a/blast/CMakeLists.txt +++ b/blast/CMakeLists.txt @@ -34,7 +34,26 @@ if(NOT TARGET nlopt) if(NOT DEFINED Python_VERSION_MINOR) set(Python_VERSION_MINOR "0") endif() + + # ====================================================================== + # FIX: Force NLopt to build as a static library to prevent missing DLLs + # ====================================================================== + set(NLOPT_CXX ON CACHE BOOL "Build NLopt with C++ compiler" FORCE) + + set(OLD_BUILD_SHARED ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries" FORCE) + add_subdirectory(extern/nlopt EXCLUDE_FROM_ALL) + + # Restore the original global setting so you don't force the outer + # project's other dependencies to be static unexpectedly + set(BUILD_SHARED_LIBS ${OLD_BUILD_SHARED} CACHE BOOL "Build static libraries" FORCE) + + # Keep the interface include fix from earlier + target_include_directories(nlopt INTERFACE + $ + $ + ) endif() # --------------------------------------------------------------------------