Skip to content

Commit

Permalink
(conan-io#22926) liblzf: avoid WINDOWS_EXPORT_ALL_SYMBOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur authored and Ahajha committed Apr 6, 2024
1 parent de9c361 commit 7197bf7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
13 changes: 5 additions & 8 deletions recipes/liblzf/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.15)
project(liblzf LANGUAGES C)

add_library(liblzf
src/lzf_c.c
src/lzf_d.c
lzf_c.c
lzf_d.c
liblzf.def
)
set_target_properties(liblzf PROPERTIES OUTPUT_NAME lzf)

Expand All @@ -20,14 +21,10 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(liblzf PRIVATE "-funroll-all-loops")
endif()

set_target_properties(liblzf PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
PUBLIC_HEADER src/lzf.h
)

include(GNUInstallDirs)
install(TARGETS liblzf
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES lzf.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
7 changes: 4 additions & 3 deletions recipes/liblzf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class LiblzfConan(ConanFile):
}

def export_sources(self):
copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder)
copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
copy(self, "liblzf.def", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
export_conandata_patches(self)

def config_options(self):
Expand All @@ -55,11 +56,11 @@ def generate(self):
def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir))
cmake.configure()
cmake.build()

def package(self):
copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()

Expand Down
3 changes: 3 additions & 0 deletions recipes/liblzf/all/liblzf.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXPORTS
lzf_compress
lzf_decompress

0 comments on commit 7197bf7

Please sign in to comment.