Skip to content

Commit 27217ec

Browse files
committed
Remove "-Werror" compile option
1 parent c395e0f commit 27217ec

File tree

8 files changed

+20
-28
lines changed

8 files changed

+20
-28
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ Liteplayer 具有如下特点:
77
4. 抽象流数据输入、音频设备输出的接口,使用者可自由添加各种流协议如 rtsp、rtmp、sdcardfs、flash 等等
88
5. 适配多个解码器,包括 pv-mp3、pv-aac、wave 等等,也可适配芯片原厂提供的解码器
99

10-
![LiteplayerArchitecture](https://github.com/sepnic/liteplayer_priv/blob/master/Liteplayer.png)
10+
编译运行:
11+
- MacOSX/Ubuntu:[How to build liteplayer for macosx/ubuntu](https://github.com/sepnic/liteplayer/blob/main/example/unix/README.md)
12+
- ESP32:[How to build liteplayer for esp32](https://github.com/sepnic/liteplayer/blob/main/example/esp32/README.md)
13+
- Android:Android Studio 打开 [example/android](https://github.com/sepnic/liteplayer/blob/main/example/android),编译运行
14+
15+
![LiteplayerArchitecture](https://github.com/sepnic/liteplayer/blob/main/Liteplayer.png)

example/android/library/src/main/cpp/CMakeLists.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ include_directories(${TOP_DIR}/include)
88
include_directories(${TOP_DIR}/adapter)
99

1010
# cflags: compile paramters
11-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Werror")
12-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
11+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall")
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
1313

1414
# mbedtls
1515
file(GLOB MBEDTLS_SRC src ${TOP_DIR}/thirdparty/mbedtls/library/*.c)
@@ -61,10 +61,9 @@ set(LITEPLAYER_CORE_SRC
6161
${TOP_DIR}/src/liteplayer_ttsplayer.c)
6262
add_library(liteplayer_core STATIC ${LITEPLAYER_CORE_SRC})
6363
target_compile_options(liteplayer_core PRIVATE
64+
-Wno-error=narrowing
6465
-DLITEPLAYER_CONFIG_SINK_FIXED_S16LE -DLITEPLAYER_CONFIG_AAC_SBR
65-
-DOSCL_IMPORT_REF= -DOSCL_EXPORT_REF= -DOSCL_UNUSED_ARG=\(void\)
66-
-Wno-error=unused-value -Wno-error=unused-function -Wno-error=narrowing
67-
-Wno-error=implicit-const-int-float-conversion -Wno-error=void-pointer-to-enum-cast)
66+
-DOSCL_IMPORT_REF= -DOSCL_EXPORT_REF= -DOSCL_UNUSED_ARG=\(void\))
6867
target_include_directories(liteplayer_core PRIVATE
6968
${TOP_DIR}/thirdparty/sysutils/include
7069
${TOP_DIR}/thirdparty/codecs

example/esp32/components/liteplayer_adapter/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ set(COMPONENT_SRCS
1717

1818
register_component()
1919

20-
target_compile_options(${COMPONENT_TARGET} PRIVATE -O3 -Wall -Werror)
20+
target_compile_options(${COMPONENT_TARGET} PRIVATE -O3 -Wall)

example/esp32/components/liteplayer_core/CMakeLists.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,9 @@ set(COMPONENT_SRCS
4646
register_component()
4747

4848
target_compile_options(${COMPONENT_TARGET} PRIVATE
49-
-O3 -Wall -Werror
49+
-O3 -Wall -Wno-error=narrowing
5050
-DLITEPLAYER_CONFIG_SINK_FIXED_S16LE
5151
-DOSCL_IMPORT_REF=
5252
-DOSCL_EXPORT_REF=
5353
-DOSCL_UNUSED_ARG=
54-
-Wno-error=unused-value
55-
-Wno-error=unused-function
56-
-Wno-error=narrowing
57-
-Wno-error=int-to-pointer-cast
5854
)
59-
60-
IF(IDF_VERSION_MAJOR GREATER 3)
61-
target_compile_options(${COMPONENT_TARGET} PRIVATE -Wno-error=implicit-fallthrough)
62-
ENDIF()

example/esp32/components/sysutils/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ set(COMPONENT_SRCS
2424
register_component()
2525

2626
target_compile_options(${COMPONENT_TARGET} PRIVATE
27-
-O3 -Wall -Werror -DOS_RTOS -DOS_FREERTOS_ESP32 -DSYSUTILS_HAVE_MBEDTLS_ENABLED)
27+
-O3 -Wall -DOS_RTOS -DOS_FREERTOS_ESP32 -DSYSUTILS_HAVE_MBEDTLS_ENABLED)

example/esp32/main/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ set(COMPONENT_SRCS app_main.c)
22

33
register_component()
44

5-
target_compile_options(${COMPONENT_TARGET} PRIVATE -O3 -Wall -Werror)
5+
target_compile_options(${COMPONENT_TARGET} PRIVATE -O3 -Wall)

example/unix/CMakeLists.txt

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ set(TOP_DIR "${CMAKE_SOURCE_DIR}/../..")
1313
# cflags: OS_LINUX, OS_ANDROID, OS_APPLE, OS_RTOS
1414
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOS_APPLE")
1515

16-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fPIC -std=gnu99 -Wall -Werror")
17-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -std=c++11 -Wall -Werror")
16+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fPIC -std=gnu99 -Wall")
17+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fPIC -std=c++11 -Wall")
1818

1919
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSYSUTILS_HAVE_MEMORY_LEAK_DETECT_ENABLED")
2020
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSYSUTILS_HAVE_MEMORY_LEAK_DETECT_ENABLED")
@@ -72,12 +72,11 @@ set(LITEPLAYER_CORE_SRC
7272
)
7373
add_library(liteplayer_core STATIC ${LITEPLAYER_CORE_SRC})
7474
target_compile_options(liteplayer_core PRIVATE
75+
-Wno-error=narrowing
7576
-D__amd64__
7677
-DLITEPLAYER_CONFIG_SINK_FIXED_S16LE
7778
-DLITEPLAYER_CONFIG_AAC_SBR
7879
-DOSCL_IMPORT_REF= -DOSCL_EXPORT_REF= -DOSCL_UNUSED_ARG=\(void\)
79-
-Wno-error=unused-value -Wno-error=unused-function -Wno-error=narrowing
80-
-Wno-error=int-to-pointer-cast
8180
)
8281
target_include_directories(liteplayer_core PRIVATE
8382
${TOP_DIR}/thirdparty/codecs
@@ -114,7 +113,6 @@ elseif(HAVE_PORT_AUDIO_ENABLED)
114113
else()
115114
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPA_LITTLE_ENDIAN")
116115
endif()
117-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations")
118116
set(PORTAUDIO_SRC
119117
${PORTAUDIO_DIR}/src/common/pa_allocation.c
120118
${PORTAUDIO_DIR}/src/common/pa_converters.c
@@ -152,7 +150,6 @@ elseif(HAVE_PORT_AUDIO_ENABLED)
152150
${TOP_DIR}/adapter/sink_portaudio_wrapper.c)
153151
endif()
154152
add_library(liteplayer_adapter STATIC ${LITEPLAYER_ADAPTER_SRC})
155-
target_compile_options(liteplayer_adapter PRIVATE -Wno-error=int-to-pointer-cast)
156153

157154
# basic_demo
158155
add_executable(basic_demo basic_demo.c)
@@ -161,7 +158,6 @@ target_link_libraries(basic_demo liteplayer_core liteplayer_adapter sysutils mbe
161158
# static_demo
162159
add_executable(static_demo static_demo.c)
163160
target_link_libraries(static_demo liteplayer_core liteplayer_adapter sysutils mbedtls pthread m)
164-
target_compile_options(static_demo PRIVATE -Wno-error=pointer-to-int-cast)
165161

166162
# playlist_demo
167163
add_executable(playlist_demo playlist_demo.c)

src/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ project(liteplayer_core)
44
set(TOP_DIR "${CMAKE_SOURCE_DIR}/..")
55

66
# cflags: OS_LINUX, OS_ANDROID, OS_APPLE, OS_RTOS
7-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fPIC -std=gnu99 -Wall -Werror -DOS_APPLE")
8-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fPIC -std=c++11 -Wall -Werror -DOS_APPLE")
7+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fPIC -std=gnu99 -Wall -DOS_APPLE")
8+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fPIC -std=c++11 -Wall -DOS_APPLE")
99

1010
# include files
1111
include_directories(${TOP_DIR}/thirdparty/sysutils/include)
@@ -40,11 +40,11 @@ set(LITEPLAYER_SRC
4040
)
4141
add_library(liteplayer_core STATIC ${LITEPLAYER_SRC})
4242
target_compile_options(liteplayer_core PRIVATE
43+
-Wno-error=narrowing
4344
-D__amd64__
4445
-DLITEPLAYER_CONFIG_SINK_FIXED_S16LE
4546
-DLITEPLAYER_CONFIG_AAC_SBR
4647
-DOSCL_IMPORT_REF= -DOSCL_EXPORT_REF= -DOSCL_UNUSED_ARG=\(void\)
47-
-Wno-error=unused-value -Wno-error=unused-function -Wno-error=narrowing
4848
)
4949
target_include_directories(liteplayer_core PRIVATE
5050
${TOP_DIR}/thirdparty/codecs

0 commit comments

Comments
 (0)