diff options
author | Yann Collet <cyan@fb.com> | 2020-11-11 00:32:49 -0800 |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-11-11 00:32:49 -0800 |
commit | d2a1f3b23935db35dc04a6842b988bec28afadab (patch) | |
tree | 1bc37f0146222dca6511ea9473430dca5fa7a2ce | |
parent | f9631e44a83b3b1278d6d3405acca20ecc8ad4c5 (diff) | |
download | lz4-d2a1f3b23935db35dc04a6842b988bec28afadab.tar.gz lz4-d2a1f3b23935db35dc04a6842b988bec28afadab.tar.bz2 lz4-d2a1f3b23935db35dc04a6842b988bec28afadab.zip |
fix cmake build of shared dll with visual
inspired from #891
-rw-r--r-- | build/cmake/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 1bb2f5a..57501ee 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -107,6 +107,10 @@ if(BUILD_SHARED_LIBS) OUTPUT_NAME lz4 SOVERSION "${LZ4_VERSION_MAJOR}" VERSION "${LZ4_VERSION_STRING}") + if(MSVC) + target_compile_definitions(lz4_shared PRIVATE + LZ4_DLL_EXPORT=1) + endif() list(APPEND LZ4_LIBRARIES_BUILT lz4_shared) endif() if(BUILD_STATIC_LIBS) |