Skip to content

Commit

Permalink
Windows: Work around CMake not finding libarchive's include directory…
Browse files Browse the repository at this point in the history
… because MSYS2 CMake doesn't like UNIX paths.
  • Loading branch information
nadiaholmquist committed Apr 18, 2024
1 parent 8447410 commit ba8d547
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/FixInterfaceIncludes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ function(fix_interface_includes)
if (PARENT_DIR MATCHES "include$")
list(APPEND NEW_DIRS "${PARENT_DIR}")
endif()

# HACK
# The libarchive pkg-config file in MSYS2 seems to include a UNIX-style path for its
# include directory and CMake doesn't like that.
if (WIN32 AND MINGW AND target STREQUAL PkgConfig::LibArchive)
list(FILTER DIRS EXCLUDE REGEX "^/[^.]+64/.*")
endif()
endforeach()

list(APPEND DIRS ${NEW_DIRS})
Expand Down

0 comments on commit ba8d547

Please sign in to comment.