blob: 078b90b7272f6a66f11502fceaedb9cb7e573c30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
idf_component_register(
SRCS bit.c decoder.c fixed.c frame.c huffman.c layer12.c layer3.c stream.c
synth.c timer.c version.c
INCLUDE_DIRS "${CMAKE_BINARY_DIR}/include"
PRIV_INCLUDE_DIRS ".")
set (MAD_H "${CMAKE_BINARY_DIR}/include/mad.h")
configure_file( "${COMPONENT_DIR}/config.h.in" "${CMAKE_BINARY_DIR}/include/config.h" )
configure_file( "${COMPONENT_DIR}/mad.h.in" "${MAD_H}" )
set(EXPORTED_HEADERS
detect_fpm.h
version.h
fixed.h
bit.h
timer.h
stream.h
frame.h
synth.h
decoder.h
)
foreach( header ${EXPORTED_HEADERS} )
file( READ "${COMPONENT_DIR}/${header}" HEADER_DATA )
string( REPLACE "# include" "// # include" HEADER_DATA_REPLACED "${HEADER_DATA}")
file( APPEND ${MAD_H} "// \"${header}\"\n\n${HEADER_DATA_REPLACED}\n" )
endforeach()
file( APPEND ${MAD_H} "# ifdef __cplusplus\n}\n# endif\n#endif\n" )
target_compile_definitions(${COMPONENT_LIB}
PRIVATE
HAVE_CONFIG_H
${FPM}
)
target_compile_options(${COMPONENT_LIB}
PRIVATE
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wall>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-implicit-function-declaration>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-Wno-stringop-overflow>
$<$<C_COMPILER_ID:AppleClang,Clang,GNU>:-fPIC>
-Wno-implicit-fallthrough
-Ofast
)
|