Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/testbench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project(SOF_TESTBENCH C)
include(../../scripts/cmake/misc.cmake)
include(CheckCCompilerFlag)

set(default_asoc_h "/usr/include/alsa/sound/uapi/asoc.h")

add_executable(testbench
testbench.c
common_test.c
Expand All @@ -31,6 +33,12 @@ target_include_directories(testbench PRIVATE
)
endif()

# Configuration time, make copy
configure_file(${default_asoc_h} ${CMAKE_CURRENT_BINARY_DIR}/include/alsa/sound/asoc.h)

# Build time
target_include_directories(testbench PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")

# -Wimplicit-fallthrough is preferred, check if it's supported
check_c_compiler_flag(-Wimplicit-fallthrough supports_implicit_fallthrough)
if (supports_implicit_fallthrough)
Expand Down
22 changes: 22 additions & 0 deletions tools/testbench/include/linux/types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: BSD-3-Clause */

#ifndef __TESTBENCH_LINUX_TYPES_H__
#define __TESTBENCH_LINUX_TYPES_H__

#include <stdint.h>

/*
* This header files allows to include asoc.h for topology parsing to
* non-gcc builds with other C library, e.g. the one that is used by
* xt-xcc compiler. The kernel linux/types.h cannot be used because
* the other definitions there are not compatible with the toolchain.
*/

/* There are minimum types needed for alsa/sound/uapi/asoc.h */

typedef int64_t __le64;
typedef int32_t __le32;
typedef int16_t __le16;
typedef uint8_t __u8;

#endif /* __TESTBENCH_LINUX_TYPES_H__ */
8 changes: 8 additions & 0 deletions tools/tplg_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project(SOF_TPLG_PARSER C)
include(../../scripts/cmake/misc.cmake)
include(CheckCCompilerFlag)

set(default_asoc_h "/usr/include/alsa/sound/uapi/asoc.h")

set(sof_source_directory "${PROJECT_SOURCE_DIR}/../..")

if (CONFIG_LIBRARY_STATIC)
Expand Down Expand Up @@ -40,6 +42,12 @@ target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/p
# TODO: The topology parser should NOT need to include RTOS header. FIX.
target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/xtos/include)

# Configuration time, make copy
configure_file(${default_asoc_h} ${CMAKE_CURRENT_BINARY_DIR}/include/alsa/sound/asoc.h)

# Build time
target_include_directories(sof_tplg_parser PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")

# -Wimplicit-fallthrough is preferred, check if it's supported
check_c_compiler_flag(-Wimplicit-fallthrough supports_implicit_fallthrough)
if (supports_implicit_fallthrough)
Expand Down
22 changes: 22 additions & 0 deletions tools/tplg_parser/include/linux/types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: BSD-3-Clause */

#ifndef __TPLG_PARSER_LINUX_TYPES_H__
#define __TPLG_PARSER_LINUX_TYPES_H__

#include <stdint.h>

/*
* This header files allows to include asoc.h for topology parsing to
* non-gcc builds with other C library, e.g. the one that is used by
* xt-xcc compiler. The kernel linux/types.h cannot be used because
* the other definitions there are not compatible with the toolchain.
*/

/* There are minimum types needed for alsa/sound/uapi/asoc.h */

typedef int64_t __le64;
typedef int32_t __le32;
typedef int16_t __le16;
typedef uint8_t __u8;

#endif /* __TPLG_PARSER_LINUX_TYPES_H__ */