Skip to content

Commit 5e5e052

Browse files
committed
Experimental AppImage glibc wrapping for backwards compatibility (older distros)
1 parent 49d02ba commit 5e5e052

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,22 @@ option(ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF)
6363
option(ENABLE_PARALLEL_CTEST "Run CTest using multiple processors" ON)
6464
option(VERBOSE_TESTS "Run CTest with maximum verbosity" OFF)
6565
option(ENABLE_COVERAGE "Scan test coverage using gcov and report" OFF)
66-
6766
option(ENABLE_LIB_DOCS "Build API documentation (requires Doxygen)" ON)
68-
6967
option(APPIMAGE_BUILD "Build to install in an AppImage (Linux only)" OFF)
70-
7168
option(USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON)
7269
option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)
7370
option(ENABLE_MAGICK "Use ImageMagick, if available" ON)
7471
option(ENABLE_OPENCV "Build with OpenCV algorithms (requires Boost, Protobuf 3)" ON)
7572
option(USE_HW_ACCEL "Enable hardware-accelerated encoding-decoding with FFmpeg 3.4+" ON)
7673

74+
if (APPIMAGE_BUILD)
75+
# Force older version of glibc and -pthread flag when building AppImage
76+
# for better backwards compatibility (i.e older distros)
77+
message("Wrapping libc for compatibility with version glibc_2.23")
78+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include /usr/local/include/force_link_glibc_2.23.h -static-libgcc")
79+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include /usr/local/include/force_link_glibc_2.23.h -static-libgcc")
80+
endif()
81+
7782
# Legacy commandline override
7883
if (DISABLE_TESTS)
7984
set(BUILD_TESTING OFF)

0 commit comments

Comments
 (0)