blob: d9da42aa13e1e92ac51ad3f9cb2b9037d436791e [file] [log] [blame]
Manish Pandey65fe3642025-03-21 12:44:42 +00001#
2# SPDX-License-Identifier: BSD-3-Clause
3# SPDX-FileCopyrightText: Copyright LibTL Contributors.
4#
5
6include_guard()
7
8include(${CMAKE_CURRENT_LIST_DIR}/common_host.cmake)
9
10find_program(CMAKE_C_COMPILER
11 NAMES "clang"
12 DOC "Path to clang."
13 REQUIRED)
14
15find_program(CMAKE_CXX_COMPILER
16 NAMES "clang++"
17 DOC "Path to clang++."
18 REQUIRED)
19
20set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
21
22foreach(language IN ITEMS ASM C CXX)
23 string(APPEND CMAKE_${language}_FLAGS_INIT "-Wno-unknown-warning-option ")
24 string(APPEND CMAKE_${language}_FLAGS_INIT "-Wno-unused-function ")
25 string(APPEND CMAKE_${language}_FLAGS_INIT "-fPIC ")
26endforeach()
27
28string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--build-id=none ")
29string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld ")