Commit 3f85183c authored by Stewart Miles's avatar Stewart Miles

Added option to disable build of tests and samples.

Added FLATBUFFERS_BUILD_TESTS option which can be used to disable
the build of flatbuffers tests and samples.

Tested:
Verified tests and samples are no longer built on Linux when
FLATBUFFERS_BUILD_TESTS=OFF.

Change-Id: Ic23ab827849ba2c4481de9ca86adc1ab8e6b828c
parent 354aad4b
......@@ -4,6 +4,7 @@ project(FlatBuffers)
# NOTE: Code coverage only works on Linux & OSX.
option(FLATBUFFERS_CODE_COVERAGE "Enable the code coverage build option." OFF)
option(FLATBUFFERS_BUILD_TESTS "Enable the build of tests and samples." ON)
set(FlatBuffers_Compiler_SRCS
include/flatbuffers/flatbuffers.h
......@@ -68,14 +69,18 @@ endif()
include_directories(include)
add_executable(flatc ${FlatBuffers_Compiler_SRCS})
add_executable(flattests ${FlatBuffers_Tests_SRCS})
add_executable(flatsamplebinary ${FlatBuffers_Sample_Binary_SRCS})
add_executable(flatsampletext ${FlatBuffers_Sample_Text_SRCS})
if(FLATBUFFERS_BUILD_TESTS)
add_executable(flattests ${FlatBuffers_Tests_SRCS})
add_executable(flatsamplebinary ${FlatBuffers_Sample_Binary_SRCS})
add_executable(flatsampletext ${FlatBuffers_Sample_Text_SRCS})
endif()
install(DIRECTORY include/flatbuffers DESTINATION include)
install(TARGETS flatc DESTINATION bin)
add_test(NAME flattest
if(FLATBUFFERS_BUILD_TESTS)
add_test(NAME flattest
CONFIGURATIONS Debug
WORKING_DIRECTORY tests
COMMAND flattests)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment