remove tests requirement on threads, add setting to disable tests

This commit is contained in:
Thomas Fussell 2017-03-18 21:30:26 -04:00
parent fe041b9aa1
commit 21d05c4572
3 changed files with 3 additions and 10 deletions

View File

@ -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)
# 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(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)" OFF)
@ -25,12 +26,8 @@ if(BENCHMARKS)
add_subdirectory(benchmarks)
endif()
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
if(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()
add_subdirectory(source)

View File

@ -9,7 +9,7 @@ int main()
ws.cell("C3").formula("=RAND()");
ws.merge_cells("C3:C4");
ws.freeze_panes("B2");
wb.save("data/sample.xlsx");
wb.save("sample.xlsx");
return 0;
}

View File

@ -80,10 +80,6 @@ source_group(runner FILES ${RUNNER})
if(MSVC)
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()
find_package(PythonInterp REQUIRED)