net-im/toxext: Add test target

Only build tests when tests are run.
This commit is contained in:
Yuri Victorovich 2022-03-21 10:50:38 -07:00
parent d17857267d
commit 5308f4b529
2 changed files with 16 additions and 1 deletions

View File

@ -14,10 +14,11 @@ LIB_DEPENDS= libopus.so:audio/opus \
libtoxcore.so:net-im/tox \
libvpx.so:multimedia/libvpx
USES= cmake localbase:ldflags pkgconfig
USES= cmake:testing localbase:ldflags pkgconfig
USE_GITHUB= yes
CMAKE_ON= BUILD_SHARED_LIBS
CMAKE_TESTING_ON= BUILD_TESTS
CFLAGS+= -fPIC # see https://github.com/toxext/toxext/issues/7

View File

@ -0,0 +1,14 @@
--- CMakeLists.txt.orig 2022-03-21 17:46:44 UTC
+++ CMakeLists.txt
@@ -15,7 +15,9 @@ endfunction()
add_subdirectory(src)
add_subdirectory(mock)
-enable_testing()
-add_subdirectory(test)
+if (BUILD_TESTS)
+ enable_testing()
+ add_subdirectory(test)
+endif()
install(EXPORT ToxExtConfig DESTINATION lib/cmake/ToxExt NAMESPACE ToxExt::)