diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-05-05 01:34:01 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-05-05 01:34:01 +0200 |
commit | e854894a3cf58936eb447e4476fb863cb05ea3f9 (patch) | |
tree | 4810bf4ef46ab05ba2c030737ecf147300e5b46f /libraries | |
parent | 0ce44dbd41efc68b7a0cc8e50c0c8d9989b800b3 (diff) | |
download | MultiMC-e854894a3cf58936eb447e4476fb863cb05ea3f9.tar MultiMC-e854894a3cf58936eb447e4476fb863cb05ea3f9.tar.gz MultiMC-e854894a3cf58936eb447e4476fb863cb05ea3f9.tar.lz MultiMC-e854894a3cf58936eb447e4476fb863cb05ea3f9.tar.xz MultiMC-e854894a3cf58936eb447e4476fb863cb05ea3f9.zip |
GH-1876 turn pack200 into a shared library
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/pack200/CMakeLists.txt | 12 | ||||
-rw-r--r-- | libraries/pack200/include/unpack200.h | 5 |
2 files changed, 10 insertions, 7 deletions
diff --git a/libraries/pack200/CMakeLists.txt b/libraries/pack200/CMakeLists.txt index b060905b..85f32408 100644 --- a/libraries/pack200/CMakeLists.txt +++ b/libraries/pack200/CMakeLists.txt @@ -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() diff --git a/libraries/pack200/include/unpack200.h b/libraries/pack200/include/unpack200.h index 9c3eda2d..30ce6656 100644 --- a/libraries/pack200/include/unpack200.h +++ b/libraries/pack200/include/unpack200.h @@ -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); |