From 145149d65915e3f2eb068032b428ee5cfc0295c9 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 28 Jul 2020 11:55:32 +0200 Subject: DEBUG Add linker map output --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3