# Copyright 2023 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # The CI builds with this custom toolchain on Linux by # setting the variable CMAKE_TOOLCHAIN_FILE. # It does several things: # * Enables thin archives to make debug symbol builds more efficient. # * Hardcodes to link with LLD and GDB indexes. # * Enables split dwarf debug builds. # * Hardcodes to build with clang. # # We have some other jobs which verify/build with different compiler # options, but those are handled with a one-off. message(STATUS "Enabling IREE Release toolchain") set(CMAKE_C_COMPILER "clang") set(CMAKE_CXX_COMPILER "clang++") set(CMAKE_C_ARCHIVE_APPEND " qT ") set(CMAKE_CXX_ARCHIVE_APPEND " qT ") set(CMAKE_C_ARCHIVE_CREATE " crT ") set(CMAKE_CXX_ARCHIVE_CREATE " crT ") set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld -Wl,--gdb-index") set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld -Wl,--gdb-index") set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld -Wl,--gdb-index") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -gsplit-dwarf -ggnu-pubnames") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gsplit-dwarf -ggnu-pubnames") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -gsplit-dwarf -ggnu-pubnames") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gsplit-dwarf -ggnu-pubnames")