mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
update samples and benchmarks build, work on ci scripts
This commit is contained in:
parent
9cdf31065c
commit
ba533688c3
|
@ -10,7 +10,14 @@ environment:
|
||||||
- STATIC: ON
|
- STATIC: ON
|
||||||
|
|
||||||
init: []
|
init: []
|
||||||
install: []
|
install:
|
||||||
|
- git clone https://github.com/Microsoft/vcpkg
|
||||||
|
- cd vcpkg
|
||||||
|
- powershell -exec bypass scripts\bootstrap.ps1
|
||||||
|
- vcpkg install cryptopp zlib
|
||||||
|
- vcpkg integrate install
|
||||||
|
- cd ..
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- git submodule update --init
|
- git submodule update --init
|
||||||
- cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSTATIC=%STATIC% -DSAMPLES=ON -DBENCHMARKS=ON
|
- cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSTATIC=%STATIC% -DSAMPLES=ON -DBENCHMARKS=ON
|
||||||
|
|
|
@ -17,7 +17,7 @@ matrix:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
- g++-6
|
- g++-6 zlib cryptopp
|
||||||
env:
|
env:
|
||||||
- COMPILER=g++-6
|
- COMPILER=g++-6
|
||||||
- COVERAGE=OFF
|
- COVERAGE=OFF
|
||||||
|
|
|
@ -1,28 +1,19 @@
|
||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
|
project(xlnt.benchmarks)
|
||||||
project(${LIBRARY_NAME}.benchmarks VERSION ${LIBRARY_VERSION} LANGUAGES CXX)
|
|
||||||
|
|
||||||
if(NOT COMBINED_PROJECT)
|
if(NOT COMBINED_PROJECT)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
add_subdirectory(${LIBRARY_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/source)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${LIBRARY_INCLUDE_DIR})
|
include_directories(${LIBRARY_INCLUDE_DIR})
|
||||||
|
|
||||||
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
||||||
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
||||||
set(SAMPLE_EXECUTABLE benchmark-${SAMPLE_NAME})
|
set(SAMPLE_EXECUTABLE benchmark-${SAMPLE_NAME})
|
||||||
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
||||||
target_link_libraries(${SAMPLE_EXECUTABLE} ${LIBRARY_NAME})
|
target_link_libraries(${SAMPLE_EXECUTABLE} xlnt)
|
||||||
if(NOT MSVC)
|
|
||||||
target_link_libraries(${SAMPLE_EXECUTABLE} Threads::Threads)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
||||||
|
|
|
@ -1,28 +1,22 @@
|
||||||
cmake_minimum_required(VERSION 3.1)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
|
project(xlnt.samples)
|
||||||
project(${LIBRARY_NAME}.samples VERSION ${LIBRARY_VERSION} LANGUAGES CXX C)
|
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
if(NOT COMBINED_PROJECT)
|
if(NOT COMBINED_PROJECT)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
add_subdirectory(${LIBRARY_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/source)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${LIBRARY_INCLUDE_DIR})
|
include_directories(${LIBRARY_INCLUDE_DIR})
|
||||||
|
|
||||||
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
||||||
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
||||||
set(SAMPLE_EXECUTABLE sample-${SAMPLE_NAME})
|
set(SAMPLE_EXECUTABLE sample-${SAMPLE_NAME})
|
||||||
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
||||||
target_link_libraries(${SAMPLE_EXECUTABLE} ${LIBRARY_NAME})
|
target_link_libraries(${SAMPLE_EXECUTABLE} ${LIBRARY_NAME})
|
||||||
if(NOT MSVC)
|
|
||||||
target_link_libraries(${SAMPLE_EXECUTABLE} Threads::Threads)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
||||||
|
|
Loading…
Reference in New Issue
Block a user