drop "libsuperderpy-" prefix from game-specific shared libraries

This commit is contained in:
Sebastian Krzyszkowiak 2019-02-26 01:42:16 +01:00
parent d05e683171
commit 43c830bf99
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
4 changed files with 20 additions and 20 deletions

View file

@ -44,7 +44,7 @@ public class Activity extends AllegroActivity {
loadLibrary("allegro_physfs");
loadLibrary("allegro_video");
loadLibrary("libsuperderpy");
loadLibrary("libsuperderpy-${LIBSUPERDERPY_GAMENAME}");
loadLibrary("lib${LIBSUPERDERPY_GAMENAME}");
}
/* By default, AllegroActivity.onCreate will cause Allegro to load the
@ -52,7 +52,7 @@ public class Activity extends AllegroActivity {
* overriding the constructor.
*/
public Activity() {
super("libgame.so");
super("libsuperderpy-game.so");
}
/** Called when the activity is first created. */

View file

@ -17,16 +17,16 @@ if (APPLE)
endif(APPLE)
add_libsuperderpy_target("${EXECUTABLE_SRC_LIST}")
target_link_libraries(${EXECUTABLE} "libsuperderpy-${LIBSUPERDERPY_GAMENAME}")
target_link_libraries(${EXECUTABLE} "lib${LIBSUPERDERPY_GAMENAME}")
if (APPLE)
target_link_libraries(${EXECUTABLE} ${ALLEGRO5_MAIN_LIBRARIES})
endif(APPLE)
install(TARGETS ${EXECUTABLE} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
add_library("libsuperderpy-${LIBSUPERDERPY_GAMENAME}" SHARED "common.c")
set_target_properties("libsuperderpy-${LIBSUPERDERPY_GAMENAME}" PROPERTIES PREFIX "")
target_link_libraries("libsuperderpy-${LIBSUPERDERPY_GAMENAME}" libsuperderpy)
install(TARGETS "libsuperderpy-${LIBSUPERDERPY_GAMENAME}" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
add_library("lib${LIBSUPERDERPY_GAMENAME}" SHARED "common.c")
set_target_properties("lib${LIBSUPERDERPY_GAMENAME}" PROPERTIES PREFIX "")
target_link_libraries("lib${LIBSUPERDERPY_GAMENAME}" libsuperderpy)
install(TARGETS "lib${LIBSUPERDERPY_GAMENAME}" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
add_subdirectory("gamestates")

View file

@ -266,24 +266,24 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
MACRO(register_gamestate name sources)
add_library("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" MODULE ${sources})
add_library("lib${LIBSUPERDERPY_GAMENAME}-${name}" MODULE ${sources})
set_target_properties("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" PROPERTIES PREFIX "")
set_target_properties("lib${LIBSUPERDERPY_GAMENAME}-${name}" PROPERTIES PREFIX "")
if (NOT EMSCRIPTEN)
if (TARGET libsuperderpy-${LIBSUPERDERPY_GAMENAME})
target_link_libraries("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" libsuperderpy-${LIBSUPERDERPY_GAMENAME})
else (TARGET libsuperderpy-${LIBSUPERDERPY_GAMENAME})
if (TARGET lib${LIBSUPERDERPY_GAMENAME})
target_link_libraries("lib${LIBSUPERDERPY_GAMENAME}-${name}" lib${LIBSUPERDERPY_GAMENAME})
else (TARGET lib${LIBSUPERDERPY_GAMENAME})
if (NOT LIBSUPERDERPY_STATIC)
target_link_libraries("libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" libsuperderpy)
target_link_libraries("lib${LIBSUPERDERPY_GAMENAME}-${name}" libsuperderpy)
endif (NOT LIBSUPERDERPY_STATIC)
endif(TARGET libsuperderpy-${LIBSUPERDERPY_GAMENAME})
endif(TARGET lib${LIBSUPERDERPY_GAMENAME})
endif (NOT EMSCRIPTEN)
install(TARGETS "libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}" DESTINATION ${GAMESTATE_INSTALL_DIR})
install(TARGETS "lib${LIBSUPERDERPY_GAMENAME}-${name}" DESTINATION ${GAMESTATE_INSTALL_DIR})
if (ANDROID)
add_dependencies(${LIBSUPERDERPY_GAMENAME}_apk "libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}")
add_dependencies(${LIBSUPERDERPY_GAMENAME}_apk "lib${LIBSUPERDERPY_GAMENAME}-${name}")
endif()
if (EMSCRIPTEN)
@ -291,7 +291,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
string(REPLACE " " ";" CFLAGS_L ${CMAKE_C_FLAGS})
set(CFLAGS_LIST ${CFLAGS_L} ${${CFLAGS}})
install(FILES "${CMAKE_BINARY_DIR}/src/gamestates/libsuperderpy-${LIBSUPERDERPY_GAMENAME}-${name}${CMAKE_SHARED_MODULE_SUFFIX}" DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIBSUPERDERPY_GAMENAME}/gamestates)
install(FILES "${CMAKE_BINARY_DIR}/src/gamestates/lib${LIBSUPERDERPY_GAMENAME}-${name}${CMAKE_SHARED_MODULE_SUFFIX}" DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIBSUPERDERPY_GAMENAME}/gamestates)
endif()
ENDMACRO()
@ -357,7 +357,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
MACRO(add_libsuperderpy_target EXECUTABLE_SRC_LIST)
if(ANDROID)
set(EXECUTABLE game)
set(EXECUTABLE superderpy-game)
add_library(${EXECUTABLE} SHARED ${EXECUTABLE_SRC_LIST})
set(APK_PATH ${CMAKE_BINARY_DIR}/android/bin/${LIBSUPERDERPY_GAMENAME}-debug.apk)
@ -408,7 +408,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
add_custom_target(${LIBSUPERDERPY_GAMENAME}_js
DEPENDS ${LIBSUPERDERPY_GAMENAME}_install ${LIBSUPERDERPY_GAMENAME}_flac_to_opus ${LIBSUPERDERPY_GAMENAME}_img_to_webp ${CMAKE_BINARY_DIR}/emscripten-imports.json
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${LIBSUPERDERPY_GAMENAME}"
COMMAND "${CMAKE_C_COMPILER}" ${CFLAGS_LIST} ../bin/${LIBSUPERDERPY_GAMENAME}${CMAKE_EXECUTABLE_SUFFIX} ../lib/libsuperderpy${CMAKE_SHARED_LIBRARY_SUFFIX} ../lib/libsuperderpy-${LIBSUPERDERPY_GAMENAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${ALLEGRO5_LIBS} ${EMSCRIPTEN_FLAGS} -o ${LIBSUPERDERPY_GAMENAME}.html --pre-js ${LIBSUPERDERPY_DIR}/src/emscripten-pre-js.js --preload-file ../share/${LIBSUPERDERPY_GAMENAME}/data --preload-file gamestates@/
COMMAND "${CMAKE_C_COMPILER}" ${CFLAGS_LIST} ../bin/${LIBSUPERDERPY_GAMENAME}${CMAKE_EXECUTABLE_SUFFIX} ../lib/libsuperderpy${CMAKE_SHARED_LIBRARY_SUFFIX} ../lib/lib${LIBSUPERDERPY_GAMENAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${ALLEGRO5_LIBS} ${EMSCRIPTEN_FLAGS} -o ${LIBSUPERDERPY_GAMENAME}.html --pre-js ${LIBSUPERDERPY_DIR}/src/emscripten-pre-js.js --preload-file ../share/${LIBSUPERDERPY_GAMENAME}/data --preload-file gamestates@/
USES_TERMINAL
VERBATIM
)

View file

@ -334,7 +334,7 @@ SYMBOL_INTERNAL void GamestateProgress(struct Game* game) {
SYMBOL_INTERNAL bool OpenGamestate(struct Game* game, struct Gamestate* gamestate) {
PrintConsole(game, "Opening gamestate \"%s\"...", gamestate->name);
char libname[1024];
snprintf(libname, 1024, "libsuperderpy-%s-%s" LIBRARY_EXTENSION, game->_priv.name, gamestate->name);
snprintf(libname, 1024, "lib%s-%s" LIBRARY_EXTENSION, game->_priv.name, gamestate->name);
gamestate->handle = dlopen(AddGarbage(game, GetLibraryPath(game, libname)), RTLD_NOW);
if (!gamestate->handle) {
FatalError(game, false, "Error while opening gamestate \"%s\": %s", gamestate->name, dlerror()); // TODO: move out