Skip to content

Commit

Permalink
Slim down binary wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
nightlark committed Feb 3, 2024
1 parent ef546c1 commit 2158376
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions helics_apps-pip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,39 @@ if(DEFINED ENV{CIBUILDWHEEL} AND HELICS_DOWNLOAD_URL AND SKBUILD_STATE STREQUAL
URL ${HELICS_DOWNLOAD_URL}
)
FetchContent_MakeAvailable(helics-bin)
# Only include the things we actually need for the helics_apps in the wheels to minimize overall file size
if(EXISTS ${helics-bin_SOURCE_DIR}/bin)
install(DIRECTORY ${helics-bin_SOURCE_DIR}/bin DESTINATION . USE_SOURCE_PERMISSIONS)
install(
DIRECTORY ${helics-bin_SOURCE_DIR}/bin/
TYPE BIN
USE_SOURCE_PERMISSIONS
)
endif()
if(EXISTS ${helics-bin_SOURCE_DIR}/lib)
install(DIRECTORY ${helics-bin_SOURCE_DIR}/lib DESTINATION . USE_SOURCE_PERMISSIONS)
endif()
if(EXISTS ${helics-bin_SOURCE_DIR}/lib64)
install(DIRECTORY ${helics-bin_SOURCE_DIR}/lib64 DESTINATION . USE_SOURCE_PERMISSIONS)
# Linux needs libzmq (libhelics isn't used); previously we added lib64 to LD_LIBRARY_PATH so auditwheel can fix up the binary wheel
# that is a bit trickier due to temporary folder skbuild/CMake uses, so instead let's include it this way...
if(LINUX OR APPLE)
if(EXISTS ${helics-bin_SOURCE_DIR}/lib)
install(
DIRECTORY ${helics-bin_SOURCE_DIR}/lib/
TYPE LIB
USE_SOURCE_PERMISSIONS
PATTERN cmake EXCLUDE
PATTERN pkgconfig EXCLUDE
PATTERN libhelics* EXCLUDE
PATTERN libzmq*
)
endif()
if(EXISTS ${helics-bin_SOURCE_DIR}/lib64)
install(
DIRECTORY ${helics-bin_SOURCE_DIR}/lib64/
TYPE LIB
USE_SOURCE_PERMISSIONS
PATTERN cmake EXCLUDE
PATTERN pkgconfig EXCLUDE
PATTERN libhelics* EXCLUDE
PATTERN libzmq*
)
endif()
endif()

# If we made a wheel from pre-built HELICS binaries, exit early!
Expand Down

0 comments on commit 2158376

Please sign in to comment.