Skip to content

Commit

Permalink
Fix dll exclusions (#878)
Browse files Browse the repository at this point in the history
* Try different regexes.

* Don't think these onecore things were there before.

* Switch order, looks odd the other way round.

* Try this.

* Better regex?

* Try simplest.

* Requiring cmake 3.21 anyway.

* Fix.

* Manual addition, see it does anything

* Try stuff from recent thread.

* Fix syntax.

* Use system cmake vs wheel.

* Wrong command to disable pypi cmake download.

* Build broken on Windows using CMake >= 3.31

* Parses from here.
  • Loading branch information
jhale authored Nov 18, 2024
1 parent 4639add commit 230d110
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...3.30)

project(BasixFull VERSION "0.10.0.0" LANGUAGES CXX)
set(BASIX_FULL_SKBUILD TRUE)
Expand Down
26 changes: 6 additions & 20 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...3.30)

# Set the version
project(Basix VERSION "0.10.0.0" LANGUAGES CXX)
Expand Down Expand Up @@ -121,32 +121,18 @@ if (MSVC)
target_compile_definitions(basix PUBLIC _USE_MATH_DEFINES)
endif()


# TODO: This if can be removed once all platforms have CMake 3.21.
if (WIN32)
install(TARGETS basix
install(TARGETS basix
EXPORT BasixTargets
RUNTIME_DEPENDENCY_SET dependencies
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/basix
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeExecutables
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
)
if (INSTALL_RUNTIME_DEPENDENCIES)
LIST(APPEND PRE_EXCLUDE_REGEXES "api-ms-.*")
LIST(APPEND PRE_EXCLUDE_REGEXES "ext-ms-.*")
install(RUNTIME_DEPENDENCY_SET dependencies DESTINATION ${CMAKE_INSTALL_BINDIR} PRE_EXCLUDE_REGEXES ${PRE_EXCLUDE_REGEXES} POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" )
endif()
else()
install(TARGETS basix
EXPORT BasixTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/basix
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeExecutables
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
)
)
if (INSTALL_RUNTIME_DEPENDENCIES AND WIN32)
# https://discourse.cmake.org/t/migration-experiences-comparison-runtime-dependency-set-vs-fixup-bundle-bundleutilities
install(RUNTIME_DEPENDENCY_SET dependencies DESTINATION ${CMAKE_INSTALL_BINDIR} PRE_EXCLUDE_REGEXES [[api-ms-win-.*]] [[ext-ms-.*]] POST_EXCLUDE_REGEXES [[.*(\\|/)system32(\\|/).*\.dll]])
endif()

# Configure CMake helpers
Expand Down

0 comments on commit 230d110

Please sign in to comment.