Skip to content

Commit

Permalink
Better CMakes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchvova committed Apr 11, 2019
1 parent dbd83fe commit 25eabaa
Show file tree
Hide file tree
Showing 16 changed files with 597 additions and 543 deletions.
84 changes: 49 additions & 35 deletions external/ALmixer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,58 @@
cmake_minimum_required(VERSION 3.4.1)
project(almixer)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSOUND_SUPPORTS_WAV -DSOUND_SUPPORTS_OGG -DANDROID_NDK -DENABLE_ALMIXER_THREADS -DALMIXER_COMPILE_WITHOUT_SDL -DNDEBUG -DALMIXER_USE_APPORTABLE_OPENAL_EXTENSIONS -DOPENAL_FIXED_POINT -DOPENAL_FIXED_POINT_SHIFT=16")

add_definitions(
-DSOUND_SUPPORTS_WAV
-DSOUND_SUPPORTS_OGG
-DENABLE_ALMIXER_THREADS
-DALMIXER_COMPILE_WITHOUT_SDL
-DALMIXER_USE_APPORTABLE_OPENAL_EXTENSIONS
-DOPENAL_FIXED_POINT
-DOPENAL_FIXED_POINT_SHIFT=16
)

# if not Corona Cards
add_definitions(
-DMPG123_NO_CONFIGURE
-DSOUND_SUPPORTS_MPG123
)

include_directories(
${LibOpenALPath}/include/AL
${LibAlMixerPath}
${LibAlMixerPath}/Isolated
${LibAlMixerPath}/Isolated/LGPL
${LibVorbisPath}
${LibMpg123Path}
${LibLuaSoPath}
../openal-soft_apportable/jni/OpenAL/include/AL
../ALmixer
Isolated
../tremor/Tremor
../mpg123-1.13.1/src/libmpg123
../lua-5.1.3/src
)

add_library( almixer SHARED
${LibAlMixerPath}/ALmixer.c
${LibAlMixerPath}/CircularQueue.c
${LibAlMixerPath}/LinkedList.c
${LibAlMixerPath}/luaal.c
${LibAlMixerPath}/Isolated/ALmixer_RWops.c
${LibAlMixerPath}/Isolated/SimpleMutex.c
${LibAlMixerPath}/Isolated/SimpleThreadPosix.c
${LibAlMixerPath}/Isolated/SoundDecoder.c
${LibAlMixerPath}/Isolated/tErrorLib.c
${LibAlMixerPath}/Isolated/LGPL/wav.c
${LibAlMixerPath}/Isolated/LGPL/mpg123.c
${LibAlMixerPath}/Isolated/LGPL/oggtremor.c
${LibAlMixerPath}/Isolated/LGPL/SDL_sound_minimal.c
${LibVorbisPath}/bitwise.c
${LibVorbisPath}/codebook.c
${LibVorbisPath}/dsp.c
${LibVorbisPath}/floor0.c
${LibVorbisPath}/floor1.c
${LibVorbisPath}/floor_lookup.c
${LibVorbisPath}/framing.c
${LibVorbisPath}/info.c
${LibVorbisPath}/mapping0.c
${LibVorbisPath}/mdct.c
${LibVorbisPath}/misc.c
${LibVorbisPath}/res012.c
${LibVorbisPath}/vorbisfile.c
ALmixer.c
CircularQueue.c
LinkedList.c
luaal.c
Isolated/ALmixer_RWops.c
Isolated/SimpleMutex.c
Isolated/SimpleThreadPosix.c
Isolated/SoundDecoder.c
Isolated/tErrorLib.c
Isolated/LGPL/wav.c
Isolated/LGPL/mpg123.c
Isolated/LGPL/oggtremor.c
Isolated/LGPL/SDL_sound_minimal.c
../tremor/Tremor/bitwise.c
../tremor/Tremor/codebook.c
../tremor/Tremor/dsp.c
../tremor/Tremor/floor0.c
../tremor/Tremor/floor1.c
../tremor/Tremor/floor_lookup.c
../tremor/Tremor/framing.c
../tremor/Tremor/info.c
../tremor/Tremor/mapping0.c
../tremor/Tremor/mdct.c
../tremor/Tremor/misc.c
../tremor/Tremor/res012.c
../tremor/Tremor/vorbisfile.c
)

target_link_libraries ( almixer openal mpg123 lua log dl OpenSLES )
target_link_libraries ( almixer openal mpg123 lua log dl OpenSLES )
1 change: 1 addition & 0 deletions external/JNLua/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.iml
build/
.externalNativeBuild/
.gradle
15 changes: 0 additions & 15 deletions external/JNLua/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
apply plugin: 'java'

repositories {
mavenCentral()
}

jar {
manifest {
attributes 'Main-Class': 'com.naef.JNLua'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//testCompile group: 'junit', name: 'junit', version: '4.12'
}
9 changes: 6 additions & 3 deletions external/JNLua/src/main/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
cmake_minimum_required(VERSION 3.4.1)
project( jnlua5.1 )
include_directories ( ${LibLuaSoPath} )
include_directories ( "${LuaIncludePath}" )

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID_NDK -DNDEBUG -D_REENTRANT -DRtt_ANDROID_ENV -DLUA_USE_POSIX -DLUA_USE_DLOPEN")
add_definitions(
-DLUA_USE_POSIX
-DLUA_USE_DLOPEN
)

add_library( jnlua5.1 SHARED ${LibJnlua51Path}/jnlua.c )
add_library( jnlua5.1 SHARED jnlua.c )
target_link_libraries ( jnlua5.1 lua log )
14 changes: 11 additions & 3 deletions external/lua-5.1.3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
cmake_minimum_required(VERSION 3.4.1)
project(lua)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DANDROID_NDK -DRtt_ANDROID_ENV -DNDEBUG -DLUA_USE_DLOPEN -DLUA_USE_POSIX")
add_definitions(-DANDROID_NDK -DRtt_ANDROID_ENV -DNDEBUG -DLUA_USE_DLOPEN -DLUA_USE_POSIX)

add_definitions(
-DLUA_USE_DLOPEN
-DLUA_USE_POSIX
)

#if(CMAKE_ANDROID_ARCH MATCHES "arm")
# add_definitions(-D_ARM_ASSEM_)
#endif()

add_library( lua SHARED
src/lapi.c
src/lauxlib.c
Expand Down Expand Up @@ -36,4 +44,4 @@ add_library( lua SHARED
src/print.c
)

target_link_libraries ( lua log dl )
target_link_libraries ( lua log dl )
67 changes: 41 additions & 26 deletions external/mpg123-1.13.1/src/libmpg123/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
cmake_minimum_required(VERSION 3.4.1)
project(mpg123)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMPG123_NO_CONFIGURE -DHAVE_STDLIB_H -DHAVE_STRERROR -DHAVE_SYS_TYPES_H -DFPM_ARM -DFIXED_POINT -DANDROID_NDK -D_ARM_ASSEM_ -DMPG123_NO_LARGENAME -DNO_REAL -DOPT_GENERIC -DNDEBUG")
add_definitions(
-DMPG123_NO_CONFIGURE
-DHAVE_STDLIB_H
-DHAVE_STRERROR
-DHAVE_SYS_TYPES_H
-DMPG123_NO_LARGENAME
-DOPT_GENERIC
-DFIXED_POINT
-DNO_REAL
)

add_definitions(
-DFPM_ARM
-D_ARM_ASSEM_
)


add_library( mpg123 SHARED
${LibMpg123Path}/compat.c
${LibMpg123Path}/dct64.c
${LibMpg123Path}/equalizer.c
${LibMpg123Path}/format.c
${LibMpg123Path}/frame.c
${LibMpg123Path}/icy.c
${LibMpg123Path}/icy2utf8.c
${LibMpg123Path}/id3.c
${LibMpg123Path}/index.c
${LibMpg123Path}/layer1.c
${LibMpg123Path}/layer2.c
${LibMpg123Path}/layer3.c
${LibMpg123Path}/libmpg123.c
${LibMpg123Path}/ntom.c
${LibMpg123Path}/optimize.c
${LibMpg123Path}/parse.c
${LibMpg123Path}/readers.c
${LibMpg123Path}/tabinit.c
${LibMpg123Path}/stringbuf.c
${LibMpg123Path}/synth.c
${LibMpg123Path}/synth_arm.S
${LibMpg123Path}/feature.c
${LibMpg123Path}/synth_8bit.c
${LibMpg123Path}/synth_s32.c
compat.c
dct64.c
equalizer.c
format.c
frame.c
icy.c
icy2utf8.c
id3.c
index.c
layer1.c
layer2.c
layer3.c
libmpg123.c
ntom.c
optimize.c
parse.c
readers.c
tabinit.c
stringbuf.c
synth.c
synth_arm.S
feature.c
synth_8bit.c
synth_s32.c
)

target_link_libraries( mpg123 log )
target_link_libraries( mpg123 log )
2 changes: 1 addition & 1 deletion external/openal-soft_apportable
1 change: 1 addition & 0 deletions platform/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ android {
}
applicationVariants.all { variant ->
variant.mergeAssetsProvider.get() dependsOn packageCoronaApp
variant.generateBuildConfigProvider.get().enabled = false
}
}

Expand Down
Loading

0 comments on commit 25eabaa

Please sign in to comment.