summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab3fec9..45422af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,8 @@ OPTION (ENABLE_CUDFREPO "Build with cudf repository support?" OFF)
OPTION (ENABLE_HAIKU "Build with Haiku package support?" OFF)
OPTION (ENABLE_APPDATA "Build with AppStream appdata support?" OFF)
+OPTION (MULTI_SEMANTICS "Build with support for multiple distribution types?" OFF)
+
OPTION (ENABLE_LZMA_COMPRESSION "Build with lzma/xz compression support?" OFF)
OPTION (ENABLE_BZIP2_COMPRESSION "Build with bzip2 compression support?" OFF)
@@ -206,6 +208,22 @@ CHECK_FUNCTION_EXISTS (fopencookie HAVE_FOPENCOOKIE)
CHECK_FUNCTION_EXISTS (funopen HAVE_FUNOPEN)
TEST_BIG_ENDIAN (WORDS_BIGENDIAN)
+IF (${CMAKE_MAJOR_VERSION} GREATER 2)
+INCLUDE (CMakePushCheckState)
+INCLUDE (CheckCCompilerFlag)
+MACRO (check_linker_flag FLAG VAR)
+ CMAKE_PUSH_CHECK_STATE (RESET)
+ SET (CMAKE_REQUIRED_FLAGS "${FLAG}")
+ CHECK_C_COMPILER_FLAG ("" "${VAR}")
+ CMAKE_POP_CHECK_STATE ()
+ENDMACRO (check_linker_flag)
+check_linker_flag("-Wl,--as-needed" HAVE_LINKER_AS_NEEDED)
+check_linker_flag("-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/libsolv.ver" HAVE_LINKER_VERSION_SCRIPT)
+ELSE (${CMAKE_MAJOR_VERSION} GREATER 2)
+SET (HAVE_LINKER_AS_NEEDED 1)
+SET (HAVE_LINKER_VERSION_SCRIPT 1)
+ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)
+
# should create config.h with #cmakedefine instead...
FOREACH (VAR HAVE_STRCHRNUL HAVE_FOPENCOOKIE HAVE_FUNOPEN WORDS_BIGENDIAN
HAVE_RPM_DB_H HAVE_PGPDIGGETPARAMS
@@ -307,7 +325,9 @@ ENDIF (ENABLE_RPMDB)
IF (ENABLE_HAIKU)
SET (SYSTEM_LIBRARIES ${HAIKU_SYSTEM_LIBRARIES} ${SYSTEM_LIBRARIES})
ENDIF (ENABLE_HAIKU)
+IF (HAVE_LINKER_AS_NEEDED)
SET (SYSTEM_LIBRARIES "-Wl,--as-needed" ${SYSTEM_LIBRARIES})
+ENDIF (HAVE_LINKER_AS_NEEDED)
ADD_SUBDIRECTORY (src)
ADD_SUBDIRECTORY (ext)