Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SwiftCmakeOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ function(swift_create_project_options)
set(x_PROJECT ${PROJECT_NAME})
endif()

if(NOT ${x_PROJECT}_BUILD_VARS_PROTECTED)
foreach(feat "TESTS" "TEST_LIBS" "EXAMPLES" "DOCS")
if(DEFINED ${x_PROJECT}_BUILD_${feat})
message(FATAL_ERROR "Something or someone has set ${x_PROJECT}_BUILD_${feat}. This is an internal option and must not be set from anywhere. Use ${x_PROJECT}_ENABLE_${feat} instead.")
endif()
endforeach()
set(${x_PROJECT}_BUILD_VARS_PROTECTED ON CACHE BOOL "Checked that nothing has set any BUILD vars manually")
endif()

set(tests_possible ON)
set(test_libs_possible ON)
if(x_DISABLE_TEST_COMPONENTS)
Expand Down