GH-1876 turn pack200 into a shared library

This commit is contained in:
Petr Mrázek 2017-05-05 01:34:01 +02:00
parent 0ce44dbd41
commit e854894a3c
3 changed files with 11 additions and 8 deletions

View File

@ -469,7 +469,7 @@ set_target_properties(MultiMC_logic PROPERTIES CXX_VISIBILITY_PRESET hidden VISI
generate_export_header(MultiMC_logic)
# Link
target_link_libraries(MultiMC_logic xz-embedded unpack200 systeminfo ${QUAZIP_LIBRARIES} ${NBT_NAME} ${ZLIB_LIBRARIES})
target_link_libraries(MultiMC_logic xz-embedded MultiMC_unpack200 systeminfo ${QUAZIP_LIBRARIES} ${NBT_NAME} ${ZLIB_LIBRARIES})
qt5_use_modules(MultiMC_logic Core Xml Network Concurrent)
add_dependencies(MultiMC_logic QuaZIP)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1)
project(unpack200)
project(MultiMC_unpack200)
option(PACK200_BUILD_BINARY "Build a tiny utility that decompresses pack200 streams" OFF)
@ -28,12 +28,14 @@ set(PACK200_SRC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(unpack200 STATIC ${PACK200_SRC})
target_include_directories(unpack200 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" PRIVATE ${ZLIB_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/src")
add_library(MultiMC_unpack200 SHARED ${PACK200_SRC})
target_include_directories(MultiMC_unpack200 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}" PRIVATE ${ZLIB_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_link_libraries(MultiMC_unpack200 ${ZLIB_LIBRARIES})
target_link_libraries(unpack200 ${ZLIB_LIBRARIES})
set_target_properties(MultiMC_unpack200 PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1)
generate_export_header(MultiMC_unpack200)
if(PACK200_BUILD_BINARY)
add_executable(anti200 anti200.cpp)
target_link_libraries(anti200 unpack200)
target_link_libraries(anti200 MultiMC_unpack200)
endif()

View File

@ -24,7 +24,8 @@
*/
#pragma once
#include <string>
#include "multimc_unpack200_export.h"
/**
* @brief Unpack a PACK200 file
@ -33,4 +34,4 @@
* @param output_path Path to the output file in PACK200 format. System native string encoding.
* @throw std::runtime_error for any error encountered
*/
void unpack_200(FILE * input_path, FILE * output_path);
MULTIMC_UNPACK200_EXPORT void unpack_200(FILE * input_path, FILE * output_path);