Skip to content

Commit

Permalink
Compress static libraries and integrate them into the build system (Q…
Browse files Browse the repository at this point in the history
  • Loading branch information
atilag authored and chriseclectic committed Jan 23, 2020
1 parent 3344357 commit 29129cf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,20 @@ else()
set(SPDLOG_LIB "")
endif()


message(STATUS "Looking for muparserx library...")

set(MUPARSERX_LIB_PATH "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/linux/lib")
if(APPLE)
set(MUPARSERX_LIB_PATH "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/macos/lib")
elseif(WIN32)
set(MUPARSERX_LIB_PATH "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win32/lib")
endif()
message(STATUS "Uncompressing muparserx static library...")
if(MSVC)
set(PLATFORM "win64")
elseif(APPLE)
set(PLATFORM "macos")
elseif(UNIX)
set(PLATFORM "linux")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E tar "xvfj" "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/${PLATFORM}/lib/muparserx.7z"
WORKING_DIRECTORY "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/${PLATFORM}/lib/")
set(MUPARSERX_LIB_PATH "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/${PLATFORM}/lib")

find_library(MUPARSERX_LIB NAMES libmuparserx.a muparserx HINTS ${MUPARSERX_LIB_PATH})
if(${MUPARSERX_LIB} MATCHES "MUPARSERX-NOTFOUND")
if(${MUPARSERX_LIB} MATCHES "MUPARSERX_LIB-NOTFOUND")
message(FATAL_ERROR "No muparserx library found")
endif()
message(STATUS "Muparserx library found: ${MUPARSERX_LIB}")
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ recursive-include src *
recursive-include contrib *
include CMakeLists.txt
include cmake/*.cmake

# Exclude static libraries (they are all compressed with 7z)
exclude src/third-party/*/lib/*.a
exclude src/third-party/*/lib/*.lib
Binary file removed src/third-party/linux/lib/libmuparserx.a
Binary file not shown.
Binary file added src/third-party/linux/lib/muparserx.7z
Binary file not shown.
Binary file added src/third-party/macos/lib/muparserx.7z
Binary file not shown.
Binary file added src/third-party/win64/lib/muparserx.7z
Binary file not shown.
Binary file removed src/third-party/win64/lib/muparserx.lib
Binary file not shown.

0 comments on commit 29129cf

Please sign in to comment.