GitHub Actions: Add libxls and tests

PiperOrigin-RevId: 454835693
Change-Id: I575ef9519ca829a2d4815e2dde4348cb9a42f36c
This commit is contained in:
Christian Blichmann 2022-06-14 05:27:12 -07:00 committed by Copybara-Service
parent 45d4b1ba5b
commit 3cb19e7378
3 changed files with 8 additions and 5 deletions

View File

@ -18,6 +18,7 @@ jobs:
- libidn2
- libraw
- libtiff
- libxls
- lodepng
- pffft
ignore-errors: [true]

View File

@ -15,6 +15,7 @@
cmake_minimum_required(VERSION 3.13..3.22)
project(sapi_libxls C CXX)
include(CTest)
include(GoogleTest)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
@ -28,7 +29,7 @@ endif()
FetchContent_Declare(libxls
GIT_REPOSITORY https://github.com/libxls/libxls.git
GIT_TAG 448240067919707eb95fb009f76f3fdb439b1427
GIT_TAG 448240067919707eb95fb009f76f3fdb439b1427 # 2021-01-04
)
FetchContent_GetProperties(libxls)
@ -72,7 +73,6 @@ add_library(libxls STATIC
"${libxls_SOURCE_DIR}/src/xls.c"
"${libxls_SOURCE_DIR}/src/xlstool.c"
)
target_include_directories(libxls PUBLIC
"${libxls_SOURCE_DIR}"
"${libxls_SOURCE_DIR}/include"
@ -102,10 +102,10 @@ target_include_directories(sapi_libxls INTERFACE
"${PROJECT_BINARY_DIR}"
)
if(SAPI_ENABLE_EXAMPLES)
if(SAPI_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
if(SAPI_ENABLE_TESTS)
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -25,4 +25,6 @@ target_link_libraries(sapi_libxls_test
sapi::test_main
)
gtest_discover_tests(sapi_libxls_test PROPERTIES ENVIRONMENT "TEST_FILES_DIR=${PROJECT_SOURCE_DIR}/files")
gtest_discover_tests(sapi_libxls_test PROPERTIES
ENVIRONMENT "TEST_FILES_DIR=${PROJECT_SOURCE_DIR}/files"
)