cmake_minimum_required(VERSION 3.25)

if(TestNoLanguages)
  project(DarwinInstallNameTool NONE)
elseif(TestUseEnableLanguage)
  project(DarwinInstallNameTool NONE)
  enable_language(C)
else()
  project(DarwinInstallNameTool C)
endif()

if(TestPlatformFallback)
  set(expected_tool "${CMAKE_CURRENT_BINARY_DIR}/test-system/install_name_tool")
else()
  set(expected_tool "${CMAKE_CURRENT_BINARY_DIR}/toolchain/llvm-install-name-tool")
endif()
if(NOT CMAKE_INSTALL_NAME_TOOL STREQUAL expected_tool)
  message(FATAL_ERROR
    "Expected CMAKE_INSTALL_NAME_TOOL to be '${expected_tool}', "
    "got '${CMAKE_INSTALL_NAME_TOOL}'")
endif()
