set(CMAKE_SYSTEM_PROCESSOR i686)

set(CMAKE_C_FLAGS_INIT -m32)
set(CMAKE_CXX_FLAGS_INIT -m32)

set(CMAKE_EXE_LINKER_FLAGS_INIT -m32)
set(CMAKE_SHARED_LINKER_FLAGS_INIT -m32)
set(CMAKE_MODULE_LINKER_FLAGS_INIT -m32)

if (DEFINED ENV{CLANG_TABLEGEN})
  set(CLANG_TABLEGEN $ENV{CLANG_TABLEGEN} CACHE FILEPATH "Path to clang-tblgen for host")
  message(STATUS "Setting CLANG_TABLEGEN = ${CLANG_TABLEGEN}")
endif ()

if (DEFINED ENV{LLVM_TABLEGEN})
  set(LLVM_TABLEGEN $ENV{LLVM_TABLEGEN} CACHE FILEPATH "Path to llvm-tblgen for host")
  message(STATUS "Setting LLVM_TABLEGEN = ${LLVM_TABLEGEN}")
endif ()
