Commit dce5339a authored by Branislav Katreniak's avatar Branislav Katreniak

cmake: remove BUILD_TOOLS option

autotools build does not have this option.
Capnp tools are built when CAPNP_LITE == OFF
parent fa059927
...@@ -25,30 +25,15 @@ set(INSTALL_TARGETS_DEFAULT_ARGS ...@@ -25,30 +25,15 @@ set(INSTALL_TARGETS_DEFAULT_ARGS
# Options ====================================================================== # Options ======================================================================
option(BUILD_TOOLS "Build command-line tools and compiler." ON)
option(BUILD_TESTING "Build unit tests and enable CTest 'check' target." ON) option(BUILD_TESTING "Build unit tests and enable CTest 'check' target." ON)
option(EXTERNAL_CAPNP "Use the system capnp binary, or the one specified in $CAPNP, instead of using the compiled one." OFF) option(EXTERNAL_CAPNP "Use the system capnp binary, or the one specified in $CAPNP, instead of using the compiled one." OFF)
option(CAPNP_LITE "Compile Cap'n Proto in 'lite mode', in which all reflection APIs (schema.h, dynamic.h, etc.) are not included. Produces a smaller library at the cost of features. All programs built against the library must be compiled with -DCAPNP_LITE. Requires EXTERNAL_CAPNP to build the tests." OFF) option(CAPNP_LITE "Compile Cap'n Proto in 'lite mode', in which all reflection APIs (schema.h, dynamic.h, etc.) are not included. Produces a smaller library at the cost of features. All programs built against the library must be compiled with -DCAPNP_LITE. Requires EXTERNAL_CAPNP." OFF)
# Check for invalid combinations of build options # Check for invalid combinations of build options
if(NOT BUILD_TOOLS AND BUILD_TESTING AND NOT EXTERNAL_CAPNP) if(CAPNP_LITE AND NOT EXTERNAL_CAPNP)
# Not *all* of the tests require the capnp compiler, and those that do could be excluded message(SEND_ERROR "You must set EXTERNAL_CAPNP when using CAPNP_LITE.")
# when not building the tools, but it's easier to just have a blanket rule.
message(SEND_ERROR "Tests (BUILD_TESTING) cannot be build without either BUILD_TOOLS or EXTERNAL_CAPNP.")
endif() endif()
if(CAPNP_LITE AND BUILD_TESTING AND NOT EXTERNAL_CAPNP)
# As above, we could exclude only the tests that depend on the compiler.
message(SEND_ERROR "CAPNP_LITE with BUILD_TESTING requires EXTERNAL_CAPNP.")
endif()
if(CAPNP_LITE AND BUILD_TOOLS)
message(WARNING "Command-line tools will not be built with CAPNP_LITE.")
endif()
if(BUILD_TOOLS AND EXTERNAL_CAPNP)
message(SEND_ERROR "EXTERNAL_CAPNP cannot be set with BUILD_TOOLS.")
endif()
if(MSVC AND NOT CAPNP_LITE) if(MSVC AND NOT CAPNP_LITE)
message(SEND_ERROR "Building with MSVC is only supported with CAPNP_LITE.") message(SEND_ERROR "Building with MSVC is only supported with CAPNP_LITE.")
......
...@@ -142,7 +142,7 @@ if(NOT CAPNP_LITE) ...@@ -142,7 +142,7 @@ if(NOT CAPNP_LITE)
install(FILES ${capnpc_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/capnp") install(FILES ${capnpc_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/capnp")
endif() endif()
if(BUILD_TOOLS AND NOT CAPNP_LITE) if(NOT CAPNP_LITE)
add_executable(capnp_tool add_executable(capnp_tool
compiler/module-loader.c++ compiler/module-loader.c++
compiler/capnp.c++ compiler/capnp.c++
...@@ -174,7 +174,7 @@ if(BUILD_TOOLS AND NOT CAPNP_LITE) ...@@ -174,7 +174,7 @@ if(BUILD_TOOLS AND NOT CAPNP_LITE)
# Symlink capnpc -> capnp # Symlink capnpc -> capnp
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc\")") install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc\")")
endif() # BUILD_TOOLS AND NOT CAPNP_LITE endif() # NOT CAPNP_LITE
# Tests ======================================================================== # Tests ========================================================================
......
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