summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:54:23 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:54:24 +0900
commit1a93853889c819ac2d3c8e83e856f4775e664b00 (patch)
tree283fb5892b7e064fb16c1f192bc61c86110f31c2 /CMakeLists.txt
parent8a7ffe4fc2b44b84fb045f80c1a016b3f200aa8b (diff)
downloadlibsolv-1a93853889c819ac2d3c8e83e856f4775e664b00.tar.gz
libsolv-1a93853889c819ac2d3c8e83e856f4775e664b00.tar.bz2
libsolv-1a93853889c819ac2d3c8e83e856f4775e664b00.zip
Imported Upstream version 0.6.11upstream/0.6.11
Change-Id: Ia7fcc570c551205421c68cc6feb2ecfd3c97e149 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
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)