From cc97c81464756f11ce3f722db3b0ac6319b58762 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Tue, 17 Mar 2026 03:55:21 -0600 Subject: [PATCH 1/2] Fix debug build for Windows and ortools per email 3/16/2026 --- CMakeLists.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 352ed4be..3ac8bc18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,6 +152,28 @@ if (NOT SAM_SKIP_TOOLS) target_link_libraries(lk_sandbox -ldl) endif () - target_link_libraries(lk_sandbox ${wxWidgets_LIBRARIES}) +# target_link_libraries(lk_sandbox ${wxWidgets_LIBRARIES}) +# message("All wxWidgets: " ${wxWidgets_LIBRARIES}) + set(FOUND "false") + foreach(lib ${wxWidgets_LIBRARIES}) + string(FIND ${lib} "optimized" INDEX) + string(FIND ${lib} "debug" INDEX2) + string(FIND ${lib} "wxWidgets" INDEX3) + if (INDEX GREATER_EQUAL 0) # skip once + set(FOUND "true") + continue() + elseif((INDEX2 LESS 0) AND (INDEX3 LESS 0)) + set(FOUND "true") + endif() + if (${FOUND} STREQUAL "true") + set(FOUND "false") +# message("lib: ${lib}") + list(APPEND WX_LIBS_LIST ${lib}) + endif() + endforeach() + + list(JOIN WX_LIBS_LIST ";" WX_LIBS) +# message("Link Libraries for lk_sandbox: ${WX_LIBS}") + target_link_libraries(lk_sandbox lk ${WX_LIBS}) endif() From e1ce2c0521f715261bef62c1aa6d7d02590125a9 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Thu, 19 Mar 2026 02:25:27 -0600 Subject: [PATCH 2/2] Update CMakeLists.txt for Windows runners --- CMakeLists.txt | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac8bc18..cf087cfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,8 +87,42 @@ if (UNIX) find_package(wxWidgets QUIET REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base) endif () else () +# set(wxWidgets_ROOT_DIR $ENV{WXMSW3}) +# find_package(wxWidgets REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla) + set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Debug and Release Builds Configured" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20") + # for linking to Release build of ortools + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") + # Get the current debug flags and remove the /D_DEBUG option. + string(REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + # following does not force release libraries for wxWidgets using find_package + #set(CMAKE_MAP_IMPORTED_CONFIG_DEBUG RELEASE) + set(wxWidgets_ROOT_DIR $ENV{WXMSW3}) - find_package(wxWidgets REQUIRED xrc stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla) + find_package(wxWidgets QUIET REQUIRED xrc webview stc richtext ribbon propgrid aui gl html qa adv core xml net base scintilla) + + # message("All wxWidgets: " ${wxWidgets_LIBRARIES}) + set(FOUND "false") + foreach(lib ${wxWidgets_LIBRARIES}) + string(FIND ${lib} "optimized" INDEX) + string(FIND ${lib} "debug" INDEX2) + string(FIND ${lib} "wxWidgets" INDEX3) + if (INDEX GREATER_EQUAL 0) # skip once + set(FOUND "true") + continue() + elseif((INDEX2 LESS 0) AND (INDEX3 LESS 0)) + set(FOUND "true") + endif() + if (${FOUND} STREQUAL "true") + set(FOUND "false") + message("lib: ${lib}") + list(APPEND WX_LIBS_LIST ${lib}) + endif() + endforeach() + + list(JOIN WX_LIBS_LIST ";" wxWidgets_LIBRARIES) + # message("Link Libraries for wxWidgets: ${wxWidgets_LIBRARIES}") + endif () if (wxWidgets_FOUND)