mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
remove tests requirement on threads, add setting to disable tests
This commit is contained in:
parent
fe041b9aa1
commit
21d05c4572
@ -8,6 +8,7 @@ set(COMBINED_PROJECT TRUE)
|
|||||||
option(STATIC "Set to ON to build xlnt as a static library instead of a shared library" OFF)
|
option(STATIC "Set to ON to build xlnt as a static library instead of a shared library" OFF)
|
||||||
|
|
||||||
# Optional components
|
# Optional components
|
||||||
|
option(TESTS "Set to OFF to skip building test executable (in ./tests)" ON)
|
||||||
option(SAMPLES "Set to ON to build executable code samples (in ./samples)" OFF)
|
option(SAMPLES "Set to ON to build executable code samples (in ./samples)" OFF)
|
||||||
option(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)" OFF)
|
option(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)" OFF)
|
||||||
|
|
||||||
@ -25,12 +26,8 @@ if(BENCHMARKS)
|
|||||||
add_subdirectory(benchmarks)
|
add_subdirectory(benchmarks)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(PythonInterp)
|
if(TESTS)
|
||||||
|
|
||||||
if(PYTHONINTERP_FOUND)
|
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
elseif(NOT PYTHONINTERP_FOUND)
|
|
||||||
message("Python couldn't be found in the current PATH but is required for building tests. Tests will be skipped for now.")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(source)
|
add_subdirectory(source)
|
||||||
|
@ -9,7 +9,7 @@ int main()
|
|||||||
ws.cell("C3").formula("=RAND()");
|
ws.cell("C3").formula("=RAND()");
|
||||||
ws.merge_cells("C3:C4");
|
ws.merge_cells("C3:C4");
|
||||||
ws.freeze_panes("B2");
|
ws.freeze_panes("B2");
|
||||||
wb.save("data/sample.xlsx");
|
wb.save("sample.xlsx");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -80,10 +80,6 @@ source_group(runner FILES ${RUNNER})
|
|||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set_target_properties(xlnt.test PROPERTIES COMPILE_FLAGS "/wd\"4251\" /wd\"4275\" /wd\"4068\"")
|
set_target_properties(xlnt.test PROPERTIES COMPILE_FLAGS "/wd\"4251\" /wd\"4275\" /wd\"4068\"")
|
||||||
else()
|
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
target_link_libraries(xlnt.test PRIVATE Threads::Threads)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(PythonInterp REQUIRED)
|
find_package(PythonInterp REQUIRED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user