File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,12 @@ outputs:
5959 - zlib
6060 - zstd
6161 test :
62+ requires :
63+ - {{ compiler('c') }}
64+ - cmake
65+ - ninja
6266 files :
63- - test/hello_world.xar
67+ - test/*
6468 commands :
6569 # Verify pkg-config file is in place.
6670 - test -f "${PREFIX}/lib/pkgconfig/libarchive.pc" # [unix]
@@ -83,6 +87,11 @@ outputs:
8387 - bsdtar --version
8488 - bsdtar -tf test/hello_world.xar
8589
90+ # Running a test trying to link to the library
91+ - cmake -G Ninja -S test/ -B build/ -D LIB_NAME="libarchive{{ SHLIB_EXT }}" ${CMAKE_ARGS} # [unix]
92+ - cmake -G Ninja -S test/ -B build/ -D LIB_NAME="archive" %CMAKE_ARGS% # [win]
93+ - cmake --build build/
94+ - cmake --build build --target test
8695
8796 - name : libarchive-minimal-static
8897 script : build_minimal.sh
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.20)
2+
3+ project (test -libarchive LANGUAGES C)
4+
5+ add_executable (test -libarchive test .c)
6+
7+ find_path (libarchive_INCLUDE_DIR NAMES archive.h)
8+ find_library (libarchive_LIBRARY NAMES "${LIB_NAME} " )
9+ target_link_libraries (test -libarchive PRIVATE ${libarchive_LIBRARY} )
10+ target_include_directories (test -libarchive PRIVATE ${libarchive_INCLUDE_DIR} )
11+
12+ enable_testing ()
13+ add_test (NAME test -libarchive COMMAND test -libarchive)
Original file line number Diff line number Diff line change 1+ #include <archive.h>
2+
3+ /** Dummy program to test basci compilation and link. */
4+ int main (int argc , const char * * argv )
5+ {
6+ struct archive * a = archive_read_new ();
7+ return archive_read_free (a );
8+ }
You can’t perform that action at this time.
0 commit comments