aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2020-07-28 11:55:32 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2020-07-28 11:55:32 +0200
commit145149d65915e3f2eb068032b428ee5cfc0295c9 (patch)
treee18ba598934c1d502eea554601c4933713c304e5
parent080b88a018e0cca01d3e89ef264173c332ab4eeb (diff)
downloadlibnitrokey-145149d65915e3f2eb068032b428ee5cfc0295c9.tar.gz
libnitrokey-145149d65915e3f2eb068032b428ee5cfc0295c9.tar.bz2
DEBUG Add linker map output
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db8d2fb..30ca485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
+set(DEV OFF)
include(GNUInstallDirs)
@@ -82,7 +83,10 @@ ELSEIF(UNIX)
# add_library(hidapi-libusb STATIC hidapi/libusb/hid.c )
find_package(PkgConfig)
pkg_search_module(HIDAPI_LIBUSB REQUIRED hidapi-libusb)
- target_compile_options(nitrokey PRIVATE ${HIDAPI_LIBUSB_CFLAGS})
+ IF(DEV)
+ target_compile_options(nitrokey PRIVATE "${HIDAPI_LIBUSB_CFLAGS} -Os")
+ target_link_options(nitrokey PRIVATE "-Wl,-Map=output.map")
+ ENDIF()
target_link_libraries(nitrokey ${HIDAPI_LIBUSB_LDFLAGS})
ELSEIF(WIN32)
include_directories(hidapi/hidapi)