Skip to content

Commit 16b4cfc

Browse files
committed
Link against libbsd on unix to get strnstr
1 parent ec4783e commit 16b4cfc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ endif()
823823
if (UNIX)
824824
set(THREADS_PREFER_PTHREAD_FLAG ON)
825825
find_package(Threads REQUIRED)
826-
target_link_libraries(modular-psu-firmware Threads::Threads)
826+
target_link_libraries(modular-psu-firmware Threads::Threads bsd)
827827
endif (UNIX)
828828

829829
target_link_libraries(modular-psu-firmware ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES})

src/eez/modules/psu/scpi/psu.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
*/
1818

1919
#include <stdio.h>
20+
#ifdef EEZ_PLATFORM_SIMULATOR_UNIX
21+
#include <bsd/string.h>
22+
#endif
2023

2124
#include <eez/sound.h>
2225
#include <eez/system.h>
@@ -226,4 +229,4 @@ void OutputBufferWriter::flush() {
226229

227230
} // namespace scpi
228231
} // namespace psu
229-
} // namespace eez
232+
} // namespace eez

0 commit comments

Comments
 (0)