Commit 2595cce7 authored by Peng Chen's avatar Peng Chen Committed by Anas Nashif
Browse files

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: default avatarChen Peng1 <peng1.chen@intel.com>
parent 18d314e7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
# 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")
+2 −1
Original line number Diff line number Diff line
@@ -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(
+5 −0
Original line number Diff line number Diff line
@@ -602,6 +602,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
+4 −1
Original line number Diff line number Diff line
@@ -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})