Switched to full static release + enable lto for the docker release image
This commit is contained in:
@@ -50,7 +50,6 @@ endif()
|
|||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-DNDEBUG)
|
add_definitions(-DNDEBUG)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|||||||
+6
-10
@@ -56,8 +56,8 @@ RUN \
|
|||||||
--disable-postproc \
|
--disable-postproc \
|
||||||
--disable-pixelutils \
|
--disable-pixelutils \
|
||||||
--disable-network \
|
--disable-network \
|
||||||
--enable-shared \
|
--disable-shared \
|
||||||
--disable-static \
|
--enable-static \
|
||||||
--enable-gpl \
|
--enable-gpl \
|
||||||
--enable-small \
|
--enable-small \
|
||||||
--enable-version3 \
|
--enable-version3 \
|
||||||
@@ -73,6 +73,7 @@ RUN \
|
|||||||
--enable-muxer=ogg,matroska,mp3,webm \
|
--enable-muxer=ogg,matroska,mp3,webm \
|
||||||
--enable-protocol=file,pipe \
|
--enable-protocol=file,pipe \
|
||||||
--enable-filter=aresample \
|
--enable-filter=aresample \
|
||||||
|
--enable-lto \
|
||||||
--extra-libs=-ldl && \
|
--extra-libs=-ldl && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install && \
|
make install && \
|
||||||
@@ -87,7 +88,7 @@ RUN \
|
|||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
DIR=/tmp/wt && mkdir -p ${DIR} && cd ${DIR} && \
|
DIR=/tmp/wt && mkdir -p ${DIR} && cd ${DIR} && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_EXAMPLES=OFF -DENABLE_LIBWTTEST=OFF -DCONNECTOR_FCGI=OFF -DUSE_SYSTEM_SQLITE3=ON && \
|
cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DSHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_EXAMPLES=OFF -DENABLE_LIBWTTEST=OFF -DCONNECTOR_FCGI=OFF -DUSE_SYSTEM_SQLITE3=ON && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install
|
make install
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ RUN \
|
|||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
DIR=/tmp/taglib && mkdir -p ${DIR} && cd ${DIR} && \
|
DIR=/tmp/taglib && mkdir -p ${DIR} && cd ${DIR} && \
|
||||||
CXXFLAGS="-I/usr/include/utf8cpp" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_BINDINGS=OFF -DBUILD_TESTING=OFF -DTRACE_IN_RELEASE=OFF -DWITH_ZLIB=ON && \
|
CXXFLAGS="-I/usr/include/utf8cpp" cmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_SHARED_LIBS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BINDINGS=OFF -DBUILD_TESTING=OFF -DTRACE_IN_RELEASE=OFF -DWITH_ZLIB=ON && \
|
||||||
make -j$(nproc) && \
|
make -j$(nproc) && \
|
||||||
make install
|
make install
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ RUN \
|
|||||||
COPY . /tmp/lms/
|
COPY . /tmp/lms/
|
||||||
RUN \
|
RUN \
|
||||||
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
|
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
|
||||||
PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig CXXFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib -Wl,--rpath-link=${PREFIX}/lib" cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} && \
|
PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig CXXFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib -Wl,--rpath-link=${PREFIX}/lib" cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} && \
|
||||||
LD_LIBRARY_PATH=${PREFIX}/lib make -j$(nproc) && \
|
LD_LIBRARY_PATH=${PREFIX}/lib make -j$(nproc) && \
|
||||||
LD_LIBRARY_PATH=${PREFIX}/lib make test && \
|
LD_LIBRARY_PATH=${PREFIX}/lib make test && \
|
||||||
make install && \
|
make install && \
|
||||||
@@ -132,11 +133,6 @@ RUN \
|
|||||||
strip --strip-all $bin && \
|
strip --strip-all $bin && \
|
||||||
cp $bin /tmp/fakeroot/bin/; \
|
cp $bin /tmp/fakeroot/bin/; \
|
||||||
done && \
|
done && \
|
||||||
for lib in ${PREFIX}/lib/*.so; \
|
|
||||||
do \
|
|
||||||
strip --strip-all $lib; \
|
|
||||||
done && \
|
|
||||||
cp -r ${PREFIX}/lib /tmp/fakeroot/lib && \
|
|
||||||
cp -r ${PREFIX}/share /tmp/fakeroot/share && \
|
cp -r ${PREFIX}/share /tmp/fakeroot/share && \
|
||||||
rm -rf /tmp/fakeroot/share/doc && \
|
rm -rf /tmp/fakeroot/share/doc && \
|
||||||
rm -rf /tmp/fakeroot/share/man
|
rm -rf /tmp/fakeroot/share/man
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
pkg_check_modules(LIBAV IMPORTED_TARGET libavcodec libavutil libavformat)
|
pkg_check_modules(LIBAV IMPORTED_TARGET libavcodec libavutil libavformat)
|
||||||
|
|
||||||
add_library(lmsav SHARED
|
add_library(lmsav STATIC
|
||||||
impl/AudioFile.cpp
|
impl/AudioFile.cpp
|
||||||
impl/RawResourceHandlerCreator.cpp
|
impl/RawResourceHandlerCreator.cpp
|
||||||
impl/Transcoder.cpp
|
impl/Transcoder.cpp
|
||||||
@@ -26,5 +26,3 @@ target_link_libraries(lmsav PUBLIC
|
|||||||
target_link_libraries(lmsav PRIVATE
|
target_link_libraries(lmsav PRIVATE
|
||||||
PkgConfig::LIBAV
|
PkgConfig::LIBAV
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsav DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
pkg_check_modules(Config++ REQUIRED IMPORTED_TARGET libconfig++)
|
pkg_check_modules(Config++ REQUIRED IMPORTED_TARGET libconfig++)
|
||||||
pkg_check_modules(Archive REQUIRED IMPORTED_TARGET libarchive)
|
pkg_check_modules(Archive REQUIRED IMPORTED_TARGET libarchive)
|
||||||
|
|
||||||
add_library(lmscore SHARED
|
add_library(lmscore STATIC
|
||||||
impl/http/Client.cpp
|
impl/http/Client.cpp
|
||||||
impl/http/SendQueue.cpp
|
impl/http/SendQueue.cpp
|
||||||
impl/ArchiveZipper.cpp
|
impl/ArchiveZipper.cpp
|
||||||
@@ -42,8 +42,6 @@ target_link_libraries(lmscore PUBLIC
|
|||||||
Wt::Wt
|
Wt::Wt
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmscore DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
add_library(lmsdatabase SHARED
|
add_library(lmsdatabase STATIC
|
||||||
impl/Artist.cpp
|
impl/Artist.cpp
|
||||||
impl/AuthToken.cpp
|
impl/AuthToken.cpp
|
||||||
impl/Cluster.cpp
|
impl/Cluster.cpp
|
||||||
@@ -54,8 +54,6 @@ target_link_libraries(lmsdatabase PUBLIC
|
|||||||
Wt::Dbo
|
Wt::Dbo
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsdatabase DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsimage SHARED
|
add_library(lmsimage STATIC
|
||||||
impl/EncodedImage.cpp
|
impl/EncodedImage.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -47,6 +47,3 @@ elseif (${LMS_IMAGE_BACKEND} STREQUAL "graphicsmagick")
|
|||||||
else ()
|
else ()
|
||||||
message(FATAL_ERROR "Invalid image library")
|
message(FATAL_ERROR "Invalid image library")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install(TARGETS lmsimage DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if (BUILD_BENCHMARKS)
|
|||||||
add_subdirectory(bench)
|
add_subdirectory(bench)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(lmsmetadata SHARED
|
add_library(lmsmetadata STATIC
|
||||||
impl/AvFormatTagReader.cpp
|
impl/AvFormatTagReader.cpp
|
||||||
impl/Lyrics.cpp
|
impl/Lyrics.cpp
|
||||||
impl/Parser.cpp
|
impl/Parser.cpp
|
||||||
@@ -34,6 +34,3 @@ target_link_libraries(lmsmetadata PUBLIC
|
|||||||
lmscore
|
lmscore
|
||||||
std::filesystem
|
std::filesystem
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsmetadata DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsartwork SHARED
|
add_library(lmsartwork STATIC
|
||||||
impl/ImageCache.cpp
|
impl/ImageCache.cpp
|
||||||
impl/ArtworkService.cpp
|
impl/ArtworkService.cpp
|
||||||
)
|
)
|
||||||
@@ -24,6 +24,3 @@ target_link_libraries(lmsartwork PUBLIC
|
|||||||
lmscore
|
lmscore
|
||||||
std::filesystem
|
std::filesystem
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsartwork DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsauth SHARED
|
add_library(lmsauth STATIC
|
||||||
impl/AuthTokenService.cpp
|
impl/AuthTokenService.cpp
|
||||||
impl/AuthServiceBase.cpp
|
impl/AuthServiceBase.cpp
|
||||||
impl/EnvService.cpp
|
impl/EnvService.cpp
|
||||||
@@ -50,6 +50,3 @@ if (USE_PAM)
|
|||||||
target_include_directories(lmsauth PRIVATE ${PAM_INCLUDE_DIR})
|
target_include_directories(lmsauth PRIVATE ${PAM_INCLUDE_DIR})
|
||||||
target_link_libraries(lmsauth PRIVATE ${PAM_LIBRARIES})
|
target_link_libraries(lmsauth PRIVATE ${PAM_LIBRARIES})
|
||||||
endif (USE_PAM)
|
endif (USE_PAM)
|
||||||
|
|
||||||
install(TARGETS lmsauth DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsfeedback SHARED
|
add_library(lmsfeedback STATIC
|
||||||
impl/internal/InternalBackend.cpp
|
impl/internal/InternalBackend.cpp
|
||||||
impl/listenbrainz/FeedbacksParser.cpp
|
impl/listenbrainz/FeedbacksParser.cpp
|
||||||
impl/listenbrainz/FeedbacksSynchronizer.cpp
|
impl/listenbrainz/FeedbacksSynchronizer.cpp
|
||||||
@@ -25,5 +25,3 @@ target_link_libraries(lmsfeedback PRIVATE
|
|||||||
target_link_libraries(lmsfeedback PUBLIC
|
target_link_libraries(lmsfeedback PUBLIC
|
||||||
lmsdatabase
|
lmsdatabase
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsfeedback DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsrecommendation SHARED
|
add_library(lmsrecommendation STATIC
|
||||||
impl/clusters/ClustersEngine.cpp
|
impl/clusters/ClustersEngine.cpp
|
||||||
impl/features/FeaturesEngineCache.cpp
|
impl/features/FeaturesEngineCache.cpp
|
||||||
impl/features/FeaturesEngine.cpp
|
impl/features/FeaturesEngine.cpp
|
||||||
@@ -25,6 +25,3 @@ target_link_libraries(lmsrecommendation PRIVATE
|
|||||||
lmssom
|
lmssom
|
||||||
std::filesystem
|
std::filesystem
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsrecommendation DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
add_library(lmsscanner SHARED
|
add_library(lmsscanner STATIC
|
||||||
impl/scanners/AudioFileScanner.cpp
|
impl/scanners/AudioFileScanner.cpp
|
||||||
impl/scanners/ImageFileScanner.cpp
|
impl/scanners/ImageFileScanner.cpp
|
||||||
impl/scanners/LyricsFileScanner.cpp
|
impl/scanners/LyricsFileScanner.cpp
|
||||||
@@ -43,6 +43,3 @@ target_link_libraries(lmsscanner PUBLIC
|
|||||||
std::filesystem
|
std::filesystem
|
||||||
Wt::Wt
|
Wt::Wt
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsscanner DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmsscrobbling SHARED
|
add_library(lmsscrobbling STATIC
|
||||||
impl/internal/InternalBackend.cpp
|
impl/internal/InternalBackend.cpp
|
||||||
impl/listenbrainz/ListenBrainzBackend.cpp
|
impl/listenbrainz/ListenBrainzBackend.cpp
|
||||||
impl/listenbrainz/ListenTypes.cpp
|
impl/listenbrainz/ListenTypes.cpp
|
||||||
@@ -26,8 +26,6 @@ target_link_libraries(lmsscrobbling PUBLIC
|
|||||||
lmsdatabase
|
lmsdatabase
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmsscrobbling DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
add_library(lmssom SHARED
|
add_library(lmssom STATIC
|
||||||
impl/DataNormalizer.cpp
|
impl/DataNormalizer.cpp
|
||||||
impl/Network.cpp
|
impl/Network.cpp
|
||||||
)
|
)
|
||||||
@@ -17,8 +17,6 @@ target_link_libraries(lmssom PUBLIC
|
|||||||
|
|
||||||
set_property(TARGET lmssom PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET lmssom PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
install(TARGETS lmssom DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
add_library(lmssubsonic SHARED
|
add_library(lmssubsonic STATIC
|
||||||
impl/endpoints/AlbumSongLists.cpp
|
impl/endpoints/AlbumSongLists.cpp
|
||||||
impl/endpoints/Bookmarks.cpp
|
impl/endpoints/Bookmarks.cpp
|
||||||
impl/endpoints/Browsing.cpp
|
impl/endpoints/Browsing.cpp
|
||||||
@@ -60,8 +60,6 @@ target_link_libraries(lmssubsonic PUBLIC
|
|||||||
Wt::Wt
|
Wt::Wt
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lmssubsonic DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
|
|
||||||
if (BUILD_BENCHMARKS)
|
if (BUILD_BENCHMARKS)
|
||||||
add_subdirectory(bench)
|
add_subdirectory(bench)
|
||||||
endif()
|
endif()
|
||||||
@@ -10,4 +10,3 @@ target_link_libraries(lms-metadata PRIVATE
|
|||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lms-metadata DESTINATION bin)
|
install(TARGETS lms-metadata DESTINATION bin)
|
||||||
|
|
||||||
|
|||||||
@@ -8,5 +8,3 @@ target_link_libraries(lms-recommendation PRIVATE
|
|||||||
lmsrecommendation
|
lmsrecommendation
|
||||||
Boost::program_options
|
Boost::program_options
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS lms-recommendation DESTINATION bin)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user