Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include (${CMAKE_ROOT}/Modules/ExternalProject.cmake)

include_directories (${CMAKE_INSTALL_PREFIX}/include)
link_directories (${CMAKE_INSTALL_PREFIX}/lib)
list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX}") # This is required when cross-compiling

project (planetblupi)
set (PB_VERSION_MAJOR 1)
Expand All @@ -23,6 +24,10 @@ set (PB_DESCRIPTION "Planet Blupi - A delirious spell-binding game")

option (PB_HTTP_VERSION_CHECK "Run a version check over HTTP (with CURL)" OFF)

set(CMAKE_CXX_FLAGS "-Wno-error=c++11-narrowing ${CMAKE_CXX_FLAGS}") # TODO: FIXME in fog.cxx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed in 51ffe89


option (ANDROID "Enable when building for Android" OFF)

configure_file (
"${PROJECT_SOURCE_DIR}/src/config.h.in"
"${PROJECT_BINARY_DIR}/include/config.h"
Expand Down Expand Up @@ -142,7 +147,7 @@ if ("${STATIC_BUILD}")
pkg_search_module (SWSCALE REQUIRED libswscale)
pkg_search_module (SWRESAMPLE REQUIRED libswresample)

if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND NOT ANDROID)
pkg_search_module (ALSA REQUIRED alsa)
pkg_search_module (PULSE REQUIRED libpulse)
endif ()
Expand All @@ -156,7 +161,11 @@ endif ()
## Main binary dependencies
###########################

add_executable (planetblupi ${sources})
if (ANDROID)
add_library (planetblupi STATIC ${sources})
else ()
add_executable (planetblupi ${sources})
endif ()

if ("${STATIC_BUILD}")
set (planetblupi_DEPS
Expand All @@ -180,7 +189,7 @@ if ("${STATIC_BUILD}")
)
endif ()

if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND NOT ANDROID)
list (APPEND planetblupi_DEPS
${ALSA_STATIC_LIBRARIES}
${PULSE_STATIC_LIBRARIES}
Expand Down Expand Up @@ -248,6 +257,9 @@ endforeach (file)
##############

install (TARGETS planetblupi
# TODO: merge conflict
#RUNTIME DESTINATION bin
#ARCHIVE DESTINATION lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

Expand Down