From 9933cab59f7e266af2453ce82a0bbff4e23f23fa Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Mon, 31 Aug 2026 20:19:58 -0500 Subject: [PATCH] build: drop the pkg-config requirement from the Windows build (#15469) The FFmpeg camera view port made pkg-config a required build tool on Windows. Windows does not ship one, so every Windows developer has to install it before the build will configure: Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Call Stack (most recent call first): CMakeLists.txt:480 (find_package) Nothing on Windows needs it. FFmpeg there is a prebuilt zip unpacked into the deps prefix, whose DLLs the top level CMakeLists already names by exact soname. The version is fixed before configure runs, so find_library against that prefix does the job, as on macOS. Also drops the CI step that installed pkg-config, gated on !SELF_HOSTED so it never ran on self-hosted runners, and re-comments the if(WIN32) block that #15234 uncommented only for that find_package. --- .github/workflows/build_orca.yml | 7 ------- CMakeLists.txt | 5 ++--- src/slic3r/CMakeLists.txt | 12 ++++++++++++ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_orca.yml b/.github/workflows/build_orca.yml index c73524d6f0..a9efaa7561 100644 --- a/.github/workflows/build_orca.yml +++ b/.github/workflows/build_orca.yml @@ -385,13 +385,6 @@ jobs: dir "C:/Program Files (x86)/Windows Kits/10/Include" choco install nsis - - name: Install pkg-config - # FFmpeg is discovered via pkg-config (pkg_check_modules LIBAV in - # src/slic3r/CMakeLists.txt); the Windows runners don't ship it. - if: runner.os == 'Windows' && !vars.SELF_HOSTED - run: | - choco install pkgconfiglite -y - - name: Build slicer Win if: runner.os == 'Windows' working-directory: ${{ github.workspace }} diff --git a/CMakeLists.txt b/CMakeLists.txt index c912cdd08f..4f5ccbeb44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -476,8 +476,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # WIN10SDK_PATH is used to point CMake to the WIN10 SDK installation directory. # We pick it from environment if it is not defined in another way # ORCA: Removed Netfabb STL fixing service support in favor of CGAL. -if(WIN32) - find_package(PkgConfig REQUIRED) +# if(WIN32) # if(NOT DEFINED WIN10SDK_PATH) # if(DEFINED ENV{WIN10SDK_PATH}) # set(WIN10SDK_PATH "$ENV{WIN10SDK_PATH}") @@ -513,7 +512,7 @@ if(WIN32) # else() # message("Building without Win10 Netfabb STL fixing service support") # endif() -endif() +# endif() if (APPLE) message("OS X SDK Path: ${CMAKE_OSX_SYSROOT}") diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index e11b5153ae..140b1cec39 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -915,6 +915,18 @@ if (APPLE) endif () target_link_libraries(libslic3r_gui ${LIBAVCODEC_LIBRARY} ${LIBSWSCALE_LIBRARY} ${LIBAVUTIL_LIBRARY}) target_include_directories(libslic3r_gui SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) +elseif (WIN32) + # Prebuilt shared FFmpeg from the deps install. Windows has no pkg-config, + # so resolve the import libraries out of the deps prefix directly; the DLLs + # are copied next to the executable by the top level CMakeLists. + find_library(LIBAVCODEC_LIBRARY NAMES avcodec PATHS ${CMAKE_PREFIX_PATH}/lib NO_DEFAULT_PATH) + find_library(LIBSWSCALE_LIBRARY NAMES swscale PATHS ${CMAKE_PREFIX_PATH}/lib NO_DEFAULT_PATH) + find_library(LIBAVUTIL_LIBRARY NAMES avutil PATHS ${CMAKE_PREFIX_PATH}/lib NO_DEFAULT_PATH) + if (NOT LIBAVCODEC_LIBRARY OR NOT LIBSWSCALE_LIBRARY OR NOT LIBAVUTIL_LIBRARY) + message(FATAL_ERROR "FFmpeg (avcodec/swscale/avutil) not found under ${CMAKE_PREFIX_PATH}/lib. Rebuild the deps.") + endif () + target_link_libraries(libslic3r_gui ${LIBAVCODEC_LIBRARY} ${LIBSWSCALE_LIBRARY} ${LIBAVUTIL_LIBRARY}) + target_include_directories(libslic3r_gui SYSTEM PRIVATE ${CMAKE_PREFIX_PATH}/include) else () pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET libavcodec