-
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.
Merge pull request #152 from fair-acc/timingBlock
- Loading branch information
Showing
13 changed files
with
963 additions
and
171 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() |
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,21 +1,28 @@ | ||
if (NOT EMSCRIPTEN AND NOT CLANG) | ||
add_library(timing INTERFACE) | ||
target_include_directories(timing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/) | ||
if(NOT EMSCRIPTEN AND NOT CLANG) | ||
add_library(timing INTERFACE include/timing.hpp include/TimingSource.hpp) | ||
target_include_directories(timing | ||
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include/) | ||
target_link_libraries(timing INTERFACE PkgConfig::saftlib | ||
PkgConfig::etherbone) | ||
|
||
if (GR_DIGITIZERS_TOPLEVEL_PROJECT) | ||
cmrc_add_resource_library( | ||
ui_assets | ||
NAMESPACE | ||
ui_assets | ||
WHENCE | ||
${imgui_SOURCE_DIR}/misc/fonts | ||
${imgui_SOURCE_DIR}/misc/fonts/Roboto-Medium.ttf) | ||
if(GR_DIGITIZERS_TOPLEVEL_PROJECT) | ||
cmrc_add_resource_library( | ||
ui_assets NAMESPACE ui_assets WHENCE ${imgui_SOURCE_DIR}/misc/fonts | ||
${imgui_SOURCE_DIR}/misc/fonts/Roboto-Medium.ttf) | ||
|
||
add_executable(test-timing src/test-timing.cpp) | ||
target_link_libraries(test-timing PRIVATE gr-digitizers-options timing PkgConfig::saftlib PkgConfig::etherbone imgui implot gnuradio-algorithm gnuradio-core ui_assets) | ||
endif () | ||
endif () | ||
add_executable(test-timing src/test-timing.cpp) | ||
target_link_libraries( | ||
test-timing | ||
PRIVATE gr-digitizers-options | ||
timing | ||
imgui | ||
implot | ||
gnuradio-algorithm | ||
gnuradio-core | ||
ui_assets) | ||
endif() | ||
endif() | ||
|
||
if (ENABLE_GR_DIGITIZERS_TESTING) | ||
add_subdirectory(test) | ||
endif () | ||
if(ENABLE_GR_DIGITIZERS_TESTING) | ||
add_subdirectory(test) | ||
endif() |
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
Oops, something went wrong.