ENDIF()
IF ("${ARCH}" STREQUAL "x86_64")
- IF (ENABLE_HYPERSCAN MATCHES "ON")
+ IF (ENABLE_HYPERSCAN MATCHES "ON" OR ENABLE_STATIC MATCHES "ON")
ENABLE_LANGUAGE(CXX)
+ SET(USE_CXX_LINKER 1)
ENDIF()
ELSE()
MESSAGE(STATUS "Hyperscan support is possible only for x86_64 architecture")
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
ENDIF(BUILD_CPU_MODE STREQUAL "32")
# Workaround with architecture specific includes
- IF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
- INCLUDE_DIRECTORIES("/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
- LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
- ENDIF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+ #IF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+ # INCLUDE_DIRECTORIES("/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+ # LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+ #ENDIF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES dl)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES resolv)
LIST(APPEND CMAKE_REQUIRED_LIBRARIES nsl)
MESSAGE(STATUS "Configuring for Linux")
+ IF(ENABLE_STATIC MATCHES "ON")
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES z)
+ ENDIF()
IF(EXISTS "/etc/debian_version")
SET(LINUX_START_SCRIPT "rspamd_debian.in")
ELSE(EXISTS "/etc/debian_version")
SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
TARGET_LINK_LIBRARIES(rspamc rspamd-server)
TARGET_LINK_LIBRARIES(rspamc ${RSPAMD_REQUIRED_LIBRARIES})
-IF (ENABLE_HYPERSCAN MATCHES "ON")
+IF(USE_CXX_LINKER)
SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX)
ENDIF()
ENDIF ()
IF (ENABLE_HYPERSCAN MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamadm hs)
- SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
ENDIF ()
+IF(USE_CXX_LINKER)
+ SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
+ENDIF()
INSTALL(TARGETS rspamadm RUNTIME DESTINATION bin)