Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into pkcs11
Browse files Browse the repository at this point in the history
  • Loading branch information
BenUdall-Microchip committed Jul 30, 2019
2 parents 5fdf6fa + 90591bb commit a0007d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6.4)
cmake_minimum_required(VERSION 3.1.0)
project(cryptoauth)

# Various Options for Build
Expand Down Expand Up @@ -85,6 +85,8 @@ endif()

add_library(cryptoauth ${CRYPTOAUTH_SRC} ${ATCACERT_DEF_SRC})

set_property(TARGET cryptoauth PROPERTY C_STANDARD 99)

if(ATCA_PRINTF)
add_definitions(-DATCAPRINTF)
endif(ATCA_PRINTF)
Expand All @@ -106,7 +108,7 @@ if(LINUX)
add_definitions(-DATCA_USE_SHARED_MUTEX)
if(HAS_LIBUSB AND ATCA_HAL_KIT_HID)
target_link_libraries(cryptoauth usb-1.0)
elseif(HAS_UDEV AND ATCA_HAL_KIT_HID)
elseif(HAS_LIBUDEV AND ATCA_HAL_KIT_HID)
target_link_libraries(cryptoauth udev)
endif()
target_link_libraries(cryptoauth rt)
Expand Down
9 changes: 6 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def build_extension(self, ext):
try:
subprocess.check_output(['cmake', cmakelist_path] + cmake_args, cwd=os.path.abspath(self.build_temp), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
msg = e.output.decode('ascii')
msg = e.output.decode('utf-8')
if 'usb' in msg:
msg += '\n\n USB libraries or headers were not located. If USB support is\n' \
' not required it can be disabled by setting the environment\n' \
Expand All @@ -156,13 +156,16 @@ def build_extension(self, ext):
' $ export CRYPTOAUTHLIB_NOUSB=True\n\n' \
' Run setup.py clean before trying install again or use the pip \n' \
' option --no-cache-dir\n'
raise Exception(msg)
raise RuntimeError(msg)

# Build the library
try:
subprocess.check_output(['cmake', '--build', '.'] + build_args, cwd=os.path.abspath(self.build_temp), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
raise Exception(e.output.decode('ascii'))
if sys.version_info[0] <= 2:
raise RuntimeError(e.output) # Python 2 doesn't handle unicode exceptions
else:
raise RuntimeError(e.output.decode('utf-8'))


class CryptoAuthCommandInstall(install):
Expand Down

0 comments on commit a0007d2

Please sign in to comment.