Skip to content

Commit

Permalink
Merge pull request #6 from ssbc/combined_cmake
Browse files Browse the repository at this point in the history
Improve Codec2 CMake script to be compatible with Windows
  • Loading branch information
tschudin authored Aug 22, 2023
2 parents 8778878 + 97a00c0 commit b958671
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 368 deletions.
5 changes: 1 addition & 4 deletions android/tinySSB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ app is active (no background syncing).

Compiling the ```tinySSB``` app is challenging because of the included
Codec2 library which must be cross-compiled to native code (for
Android smartphones). If on Windows you may have to change the file
```tinySSB/app/src/main/codec2/src/CMakeLists.txt``` and add a
```.exe``` suffix to a file name, see
```tinySSB/app/src/main/codec2/src/CMakeLists-for-windows.txt```.
Android smartphones).

The compilation is currently configured to generate an APK that
runs on devices in the range of Android 8/Oreo to Android 12 (SDK 26 to 31).
Expand Down
363 changes: 0 additions & 363 deletions android/tinySSB/app/src/main/codec2/src/CMakeLists-for-windows.txt

This file was deleted.

5 changes: 4 additions & 1 deletion android/tinySSB/app/src/main/codec2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ set(CODEBOOKSNEWAMP2_ENERGY
# when crosscompiling we need a native executable
if(CMAKE_CROSSCOMPILING)
set(CMAKE_DISABLE_SOURCE_CHANGES OFF)
if(CMAKE_HOST_WIN32)
set(GENERATE_CODEBOOK_EXTENSION ".exe")
endif(CMAKE_HOST_WIN32)
include(ExternalProject)
ExternalProject_Add(codec2_native
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/codec2_native
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target generate_codebook
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/codec2_native/src/generate_codebook ${CMAKE_CURRENT_BINARY_DIR}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/codec2_native/src/generate_codebook${GENERATE_CODEBOOK_EXTENSION} ${CMAKE_CURRENT_BINARY_DIR}
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/generate_codebook
)
add_executable(generate_codebook IMPORTED)
Expand Down

0 comments on commit b958671

Please sign in to comment.