-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexander Krimm <A.Krimm@gsi.de>
- Loading branch information
Showing
3 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
function(add_ut_test TEST_NAME) | ||
add_executable(${TEST_NAME} ${TEST_NAME}.cc) | ||
if ((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")) # needed for clang15 (false positives, fixed in clang16) | ||
target_compile_options(${TEST_NAME} PRIVATE -Wall) | ||
target_link_options(${TEST_NAME} PRIVATE -Wall) | ||
else () | ||
target_compile_options(${TEST_NAME} PRIVATE -fsanitize=address -Wall) | ||
target_link_options(${TEST_NAME} PRIVATE -fsanitize=address -Wall) | ||
endif () | ||
target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}) | ||
target_link_libraries(${TEST_NAME} PRIVATE gnuradio-core gr-digitizers refl-cpp fmt ut) | ||
add_test(NAME ${TEST_NAME} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}) | ||
add_executable(${TEST_NAME} ${TEST_NAME}.cc) | ||
if((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")) # needed for clang15 (false | ||
# positives, fixed in clang16) | ||
target_compile_options(${TEST_NAME} PRIVATE -Wall) | ||
target_link_options(${TEST_NAME} PRIVATE -Wall) | ||
else() | ||
target_compile_options(${TEST_NAME} PRIVATE -fsanitize=address -Wall) | ||
target_link_options(${TEST_NAME} PRIVATE -fsanitize=address -Wall) | ||
endif() | ||
target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_BINARY_DIR}/include | ||
${CMAKE_CURRENT_BINARY_DIR}) | ||
target_link_libraries(${TEST_NAME} PRIVATE gnuradio-core gr-digitizers fmt ut) | ||
add_test(NAME ${TEST_NAME} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} | ||
${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}) | ||
endfunction() | ||
|
||
add_ut_test(qa_BlockScalingOffset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
# TODO do not hardcode | ||
add_library(ps4000a SHARED IMPORTED GLOBAL) | ||
set_property(TARGET ps4000a PROPERTY | ||
IMPORTED_LOCATION ${PICOSCOPE_PREFIX}/lib/libps4000a.so) | ||
set_property(TARGET ps4000a PROPERTY IMPORTED_LOCATION | ||
${PICOSCOPE_PREFIX}/lib/libps4000a.so) | ||
target_link_libraries(ps4000a INTERFACE PkgConfig::zlib PkgConfig::libusb) | ||
target_include_directories(ps4000a INTERFACE ${PICOSCOPE_PREFIX}/include/libps4000a ${PICOSCOPE_PREFIX}/include/libps5000a) # Hack: PicoCallback.h is missing in libps4000a/ | ||
target_include_directories( | ||
ps4000a INTERFACE ${PICOSCOPE_PREFIX}/include/libps4000a | ||
${PICOSCOPE_PREFIX}/include/libps5000a) # Hack: | ||
# PicoCallback.h is | ||
# missing in | ||
# libps4000a/ | ||
|
||
add_library(ps5000a SHARED IMPORTED GLOBAL) | ||
set_property(TARGET ps5000a PROPERTY | ||
IMPORTED_LOCATION ${PICOSCOPE_PREFIX}/lib/libps5000a.so) | ||
set_property(TARGET ps5000a PROPERTY IMPORTED_LOCATION | ||
${PICOSCOPE_PREFIX}/lib/libps5000a.so) | ||
target_link_libraries(ps5000a INTERFACE PkgConfig::zlib PkgConfig::libusb) | ||
target_include_directories(ps5000a INTERFACE ${PICOSCOPE_PREFIX}/include/libps5000a) | ||
target_include_directories(ps5000a | ||
INTERFACE ${PICOSCOPE_PREFIX}/include/libps5000a) | ||
|
||
add_library(fair-picoscope INTERFACE) | ||
target_include_directories(fair-picoscope INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include/>) | ||
target_include_directories( | ||
fair-picoscope INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:include/>) | ||
|
||
target_link_libraries(fair-picoscope INTERFACE ps4000a ps5000a gr-digitizers-options gnuradio-core refl-cpp fmt) | ||
set_target_properties(gr-digitizers PROPERTIES PUBLIC_HEADER "Picoscope.hpp;Picoscope4000a.hpp;StatusMessages.hpp") | ||
target_link_libraries( | ||
fair-picoscope INTERFACE ps4000a ps5000a gr-digitizers-options gnuradio-core | ||
fmt) | ||
set_target_properties( | ||
gr-digitizers | ||
PROPERTIES PUBLIC_HEADER | ||
"Picoscope.hpp;Picoscope4000a.hpp;StatusMessages.hpp") | ||
|
||
if (ENABLE_GR_DIGITIZERS_TESTING) | ||
add_subdirectory(test) | ||
endif () | ||
if(ENABLE_GR_DIGITIZERS_TESTING) | ||
add_subdirectory(test) | ||
endif() |