cmake: oneApi: add oneApi support on windows.
add .S file extension suffix into CMAKE_ASM_SOURCE_FILE_EXTENSIONS, because clang from OneApi can't recongnize them as asm files on windows, then they won't be added into build system. Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
This commit is contained in:
parent
98f324000c
commit
fbe13b7bc2
|
@ -1,7 +1,8 @@
|
|||
# Copyright (c) 2019 Intel Corp.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "Clang"
|
||||
OR CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
# We rely on GAS for assembling, so don't use the integrated assembler
|
||||
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:-no-integrated-as>)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
|
|
|
@ -12,7 +12,8 @@ endif()
|
|||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_ARCH "i386")
|
||||
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT "elf32-i386")
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang"
|
||||
OR CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
|
||||
zephyr_compile_options(-Qunused-arguments)
|
||||
|
||||
zephyr_cc_option(
|
||||
|
|
|
@ -609,6 +609,11 @@ endif()
|
|||
include(${ZEPHYR_BASE}/cmake/target_toolchain.cmake)
|
||||
|
||||
project(Zephyr-Kernel VERSION ${PROJECT_VERSION})
|
||||
|
||||
# Add .S file extension suffix into CMAKE_ASM_SOURCE_FILE_EXTENSIONS,
|
||||
# because clang from OneApi can't recongnize them as asm files on
|
||||
# windows now.
|
||||
list(APPEND CMAKE_ASM_SOURCE_FILE_EXTENSIONS "S")
|
||||
enable_language(C CXX ASM)
|
||||
# The setup / configuration of the toolchain itself and the configuration of
|
||||
# supported compilation flags are now split, as this allows to use the toolchain
|
||||
|
|
|
@ -7,7 +7,10 @@ endif()
|
|||
|
||||
find_program(CMAKE_AR llvm-ar ${find_program_clang_args} )
|
||||
find_program(CMAKE_NM llvm-nm ${find_program_clang_args} )
|
||||
find_program(CMAKE_OBJDUMP llvm-objdump ${find_program_clang_args} )
|
||||
# In OneApi installation directory on Windows, there is no llvm-objdump
|
||||
# binary, so would better use objdump from system environment both
|
||||
# on Linux and Windows.
|
||||
find_program(CMAKE_OBJDUMP objdump ${find_program_binutils_args})
|
||||
find_program(CMAKE_RANLIB llvm-ranlib ${find_program_clang_args} )
|
||||
find_program(CMAKE_OBJCOPY llvm-objcopy ${find_program_binutils_args})
|
||||
find_program(CMAKE_READELF readelf ${find_program_binutils_args})
|
||||
|
|
Loading…
Reference in a new issue