aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt40
1 files changed, 29 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 039a1bf71..994d47691 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,6 +154,10 @@ if(ARCH_ID STREQUAL "powerpc")
set(PPC 1)
endif()
+if(ARCH_ID STREQUAL "s390x")
+ set(S390X 1)
+endif()
+
if(WIN32 OR ARM OR PPC64LE OR PPC64 OR PPC)
set(OPT_FLAGS_RELEASE "-O2")
else()
@@ -431,7 +435,7 @@ if(STATIC AND NOT IOS)
endif()
endif()
-find_package(PCSC)
+find_package(HIDAPI)
add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
add_definition_if_library_exists(c explicit_bzero "strings.h" HAVE_EXPLICIT_BZERO)
@@ -472,14 +476,14 @@ endif()
include_directories(${LIBUNWIND_INCLUDE})
link_directories(${LIBUNWIND_LIBRARY_DIRS})
-# Final setup for libpcsc
-if (PCSC_FOUND)
- message(STATUS "Using PCSC include dir at ${PCSC_INCLUDE_DIR}")
- add_definitions(-DHAVE_PCSC)
- include_directories(${PCSC_INCLUDE_DIR})
- link_directories(${LIBPCSC_LIBRARY_DIRS})
-else (PCSC_FOUND)
- message(STATUS "Could not find PCSC")
+# Final setup for hid
+if (HIDAPI_FOUND)
+ message(STATUS "Using HIDAPI include dir at ${HIDAPI_INCLUDE_DIR}")
+ add_definitions(-DHAVE_HIDAPI)
+ include_directories(${HIDAPI_INCLUDE_DIR})
+ link_directories(${LIBHIDAPI_LIBRARY_DIRS})
+else (HIDAPI_FOUND)
+ message(STATUS "Could not find HIDAPI")
endif()
if(MSVC)
@@ -641,12 +645,14 @@ else()
message(STATUS "AES support explicitly disabled")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_AES")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_AES")
- elseif(NOT ARM AND NOT PPC64LE AND NOT PPC64 AND NOT PPC)
+ elseif(NOT ARM AND NOT PPC64LE AND NOT PPC64 AND NOT PPC AND NOT S390X)
message(STATUS "AES support enabled")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
elseif(PPC64LE OR PPC64 OR PPC)
message(STATUS "AES support not available on POWER")
+ elseif(S390X)
+ message(STATUS "AES support not available on s390x")
elseif(ARM6)
message(STATUS "AES support not available on ARMv6")
elseif(ARM7)
@@ -868,13 +874,25 @@ elseif(DRAGONFLY)
set(EXTRA_LIBRARIES execinfo ${COMPAT})
elseif(CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(EXTRA_LIBRARIES socket nsl resolv)
-elseif(NOT MSVC)
+elseif(NOT MSVC AND NOT DEPENDS)
find_library(RT rt)
set(EXTRA_LIBRARIES ${RT})
endif()
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
+if (HIDAPI_FOUND)
+ if (APPLE)
+ find_library(COREFOUNDATION CoreFoundation)
+ find_library(IOKIT IOKit)
+ list(APPEND EXTRA_LIBRARIES ${IOKIT})
+ list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION})
+ endif()
+ if (WIN32)
+ list(APPEND EXTRA_LIBRARIES setupapi)
+ endif()
+endif()
+
option(USE_READLINE "Build with GNU readline support." ON)
if(USE_READLINE)
find_package(Readline)