Skip to content

Commit 4a872ea

Browse files
committed
Fix all missing project warnings.
CMake really wants us to include this for some reason. I'm not sure why, but it's easy enough to shut up.
1 parent f608813 commit 4a872ea

File tree

17 files changed

+154
-118
lines changed

17 files changed

+154
-118
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
project(BitmapPlasma LANGUAGES C)
23

34
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-unused-function")
45

5-
add_library(plasma SHARED
6-
plasma.c)
6+
add_library(plasma SHARED plasma.c)
77

88
# Include libraries needed for plasma lib
99
target_link_libraries(plasma
10-
android
11-
jnigraphics
12-
log
13-
m)
10+
android
11+
jnigraphics
12+
log
13+
m
14+
)

camera/basic/src/main/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616

1717
cmake_minimum_required(VERSION 3.22.1)
18+
project(CameraBasic LANGUAGES C CXX)
1819

1920
set(CMAKE_VERBOSE_MAKEFILE on)
2021
set(COMMON_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../common)

camera/texture-view/src/main/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616

1717
cmake_minimum_required(VERSION 3.22.1)
18+
project(CameraTextureView LANGUAGES CXX)
1819

1920
set(CMAKE_VERBOSE_MAKEFILE on)
2021
set(COMMON_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../common)

endless-tunnel/app/src/main/cpp/CMakeLists.txt

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
#
1616

1717
cmake_minimum_required(VERSION 3.22.1)
18+
project(EndlessTunnel LANGUAGES C CXX)
1819

1920
# build native_app_glue as a static lib
2021
add_library(native_app_glue STATIC
21-
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
22+
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
23+
)
2224

2325
# Export ANativeActivity_onCreate(),
2426
# Refer to: https://github.com/android-ndk/ndk/issues/381.
@@ -34,43 +36,46 @@ add_subdirectory(glm)
3436

3537
# now build app's shared lib
3638
add_library(game SHARED
37-
android_main.cpp
38-
anim.cpp
39-
ascii_to_geom.cpp
40-
dialog_scene.cpp
41-
indexbuf.cpp
42-
input_util.cpp
43-
jni_util.cpp
44-
native_engine.cpp
45-
obstacle.cpp
46-
obstacle_generator.cpp
47-
our_shader.cpp
48-
play_scene.cpp
49-
scene.cpp
50-
scene_manager.cpp
51-
sfxman.cpp
52-
shader.cpp
53-
shape_renderer.cpp
54-
tex_quad.cpp
55-
text_renderer.cpp
56-
texture.cpp
57-
ui_scene.cpp
58-
util.cpp
59-
vertexbuf.cpp
60-
welcome_scene.cpp)
39+
android_main.cpp
40+
anim.cpp
41+
ascii_to_geom.cpp
42+
dialog_scene.cpp
43+
indexbuf.cpp
44+
input_util.cpp
45+
jni_util.cpp
46+
native_engine.cpp
47+
obstacle.cpp
48+
obstacle_generator.cpp
49+
our_shader.cpp
50+
play_scene.cpp
51+
scene.cpp
52+
scene_manager.cpp
53+
sfxman.cpp
54+
shader.cpp
55+
shape_renderer.cpp
56+
tex_quad.cpp
57+
text_renderer.cpp
58+
texture.cpp
59+
ui_scene.cpp
60+
util.cpp
61+
vertexbuf.cpp
62+
welcome_scene.cpp
63+
)
6164

6265
target_include_directories(game PRIVATE
63-
${CMAKE_CURRENT_SOURCE_DIR}
64-
${CMAKE_CURRENT_SOURCE_DIR}/data
65-
${ANDROID_NDK}/sources/android/native_app_glue)
66+
${CMAKE_CURRENT_SOURCE_DIR}
67+
${CMAKE_CURRENT_SOURCE_DIR}/data
68+
${ANDROID_NDK}/sources/android/native_app_glue
69+
)
6670

6771
# add lib dependencies
6872
target_link_libraries(game
69-
android
70-
native_app_glue
71-
atomic
72-
EGL
73-
GLESv2
74-
glm
75-
log
76-
OpenSLES)
73+
android
74+
native_app_glue
75+
atomic
76+
EGL
77+
GLESv2
78+
glm
79+
log
80+
OpenSLES
81+
)

gles3jni/app/src/main/cpp/CMakeLists.txt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
project(Gles3Jni LANGUAGES C CXX)
3+
24
# set targetPlatform, will be passed in from gradle when this sample is completed
35
# openGL Supportability
46
# platform status
@@ -22,27 +24,29 @@ cmake_minimum_required(VERSION 3.22.1)
2224
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
2325
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions -Wall")
2426
if (${ANDROID_PLATFORM_LEVEL} LESS 12)
25-
message(FATAL_ERROR "OpenGL 2 is not supported before API level 11 \
27+
message(FATAL_ERROR "OpenGL 2 is not supported before API level 11 \
2628
(currently using ${ANDROID_PLATFORM_LEVEL}).")
27-
return()
29+
return()
2830
elseif (${ANDROID_PLATFORM_LEVEL} LESS 18)
29-
add_definitions("-DDYNAMIC_ES3")
30-
set(GL3STUB_SRC gl3stub.c)
31-
set(OPENGL_LIB GLESv2)
31+
add_definitions("-DDYNAMIC_ES3")
32+
set(GL3STUB_SRC gl3stub.c)
33+
set(OPENGL_LIB GLESv2)
3234
else ()
33-
set(OPENGL_LIB GLESv3)
35+
set(OPENGL_LIB GLESv3)
3436
endif (${ANDROID_PLATFORM_LEVEL} LESS 12)
3537

3638
add_library(gles3jni SHARED
37-
${GL3STUB_SRC}
38-
gles3jni.cpp
39-
RendererES2.cpp
40-
RendererES3.cpp)
39+
${GL3STUB_SRC}
40+
gles3jni.cpp
41+
RendererES2.cpp
42+
RendererES3.cpp
43+
)
4144

4245
# Include libraries needed for gles3jni lib
4346
target_link_libraries(gles3jni
44-
${OPENGL_LIB}
45-
android
46-
EGL
47-
log
48-
m)
47+
${OPENGL_LIB}
48+
android
49+
EGL
50+
log
51+
m
52+
)
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
project(HelloGl2 LANGUAGES CXX)
23

34
# now build app's shared lib
45
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
56

6-
add_library(gl2jni SHARED
7-
gl_code.cpp)
7+
add_library(gl2jni SHARED gl_code.cpp)
88

99
# add lib dependencies
1010
target_link_libraries(gl2jni
11-
android
12-
log
13-
EGL
14-
GLESv2)
11+
android
12+
log
13+
EGL
14+
GLESv2
15+
)
1516

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
project(HelloJniCallback LANGUAGES C)
23

3-
add_library(hello-jnicallback SHARED
4-
hello-jnicallback.c)
4+
add_library(hello-jnicallback SHARED hello-jnicallback.c)
55

66
# Include libraries needed for hello-jnicallback lib
77
target_link_libraries(hello-jnicallback
8-
android
9-
log)
8+
android
9+
log
10+
)

hello-libs/app/src/main/cpp/CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717

1818
cmake_minimum_required(VERSION 3.22.1)
19+
project(HelloLibs LANGUAGES CXX)
1920

2021
# configure import libs
2122
set(distribution_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution)
@@ -34,14 +35,17 @@ set_target_properties(lib_gperf PROPERTIES IMPORTED_LOCATION
3435
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
3536

3637
add_library(hello-libs SHARED
37-
hello-libs.cpp)
38+
hello-libs.cpp
39+
)
3840

3941
target_include_directories(hello-libs PRIVATE
40-
${distribution_DIR}/gmath/include
41-
${distribution_DIR}/gperf/include)
42+
${distribution_DIR}/gmath/include
43+
${distribution_DIR}/gperf/include
44+
)
4245

4346
target_link_libraries(hello-libs
44-
android
45-
lib_gmath
46-
lib_gperf
47-
log)
47+
android
48+
lib_gmath
49+
lib_gperf
50+
log
51+
)

hello-neon/app/src/main/cpp/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
project(HelloNeon LANGUAGES C)
23

34
# build cpufeatures as a static lib
45
add_library(cpufeatures STATIC
5-
${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
6+
${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c
7+
)
68

79
# build app's shared lib
810

@@ -13,12 +15,12 @@ add_library(cpufeatures STATIC
1315
# [This example only build for armeabi-v7a, x86 could be done the same way]
1416
#
1517
if (${ANDROID_ABI} STREQUAL "armeabi-v7a")
16-
# make a list of neon files and add neon compiling flags to them
17-
set(neon_SRCS helloneon-intrinsics.c)
18+
# make a list of neon files and add neon compiling flags to them
19+
set(neon_SRCS helloneon-intrinsics.c)
1820

19-
set_property(SOURCE ${neon_SRCS}
20-
APPEND_STRING PROPERTY COMPILE_FLAGS " -mfpu=neon")
21-
add_definitions("-DHAVE_NEON=1")
21+
set_property(SOURCE ${neon_SRCS}
22+
APPEND_STRING PROPERTY COMPILE_FLAGS " -mfpu=neon")
23+
add_definitions("-DHAVE_NEON=1")
2224
elseif (${ANDROID_ABI} STREQUAL "x86")
2325
set(neon_SRCS helloneon-intrinsics.c)
2426
set_property(SOURCE ${neon_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS

native-activity/app/src/main/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616

1717
cmake_minimum_required(VERSION 3.22.1)
18+
project(NativeActivity LANGUAGES C CXX)
1819

1920
# build native_app_glue as a static lib
2021
set(${CMAKE_C_FLAGS}, "${CMAKE_C_FLAGS}")

0 commit comments

Comments
 (0)