mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Create portable builds
Which set rpath to $ORIGIN so it can be run out the box.
This commit is contained in:
parent
5a93b67bd9
commit
1e550e9059
3 changed files with 17 additions and 7 deletions
|
@ -16,13 +16,13 @@ matrix:
|
|||
services:
|
||||
- docker
|
||||
env:
|
||||
- OPENRCT2_CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=OpenRCT2" TARGET=ubuntu_amd64
|
||||
- OPENRCT2_CMAKE_OPTS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=OpenRCT2 -DPORTABLE=ON" TARGET=ubuntu_amd64
|
||||
- secure: "S3u2VCE2Vy8KNXoeh+DhnzjCmgTX0r95uEZrXDU+IKANOOCKn7Dg4OFDZE3LY/i1y2/EUDpnR5yLC38Ks795EUP/sv/OoMl4tjQ20yERjqWh+gcIRrgx7SdVabuAh3t4aBdaLD4Pfnj5avxeCt6rL7yGnj0wdbrbJSBZPsgSnuQ="
|
||||
after_success:
|
||||
- sudo chown -R $USER build
|
||||
- cd build
|
||||
# make install is done inside docker
|
||||
- mv OpenRCT2/bin/openrct2 OpenRCT2/ && mv OpenRCT2/share/openrct2 OpenRCT2/data && mv OpenRCT2/share/doc/openrct2 OpenRCT2/doc
|
||||
- mv OpenRCT2/bin/openrct2 OpenRCT2/ && mv OpenRCT2/bin/libopenrct2.so OpenRCT2/ && mv OpenRCT2/share/openrct2 OpenRCT2/data && mv OpenRCT2/share/doc/openrct2 OpenRCT2/doc
|
||||
- rm -rf OpenRCT2/bin OpenRCT2/share # remove empty dirs
|
||||
- tar cvzf openrct2-linux.tar.gz OpenRCT2/
|
||||
- if [[ "z${TRAVIS_TAG}" != "z" ]] ; then
|
||||
|
|
|
@ -11,6 +11,7 @@ set(TITLE_SEQUENCE_SHA1 "79ffb2585d12abcbfce205d7696e3472a504b005")
|
|||
|
||||
option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.")
|
||||
option(WITH_TESTS "Build tests")
|
||||
option(PORTABLE "Create a portable build (-rpath=$ORIGIN)" OFF)
|
||||
|
||||
# Define current git branch
|
||||
execute_process(
|
||||
|
@ -81,11 +82,15 @@ install(CODE "file(DOWNLOAD ${TITLE_SEQUENCE_URL} \$ENV{DESTDIR}${CMAKE_INSTALL_
|
|||
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/title/ \"${CMAKE_COMMAND}\" -E tar xvf title-sequences.zip)")
|
||||
install(CODE "file(REMOVE \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/title/title-sequences.zip)")
|
||||
if (WIN32)
|
||||
install(TARGETS "libopenrct2" RUNTIME DESTINATION bin)
|
||||
install(TARGETS "libopenrct2" RUNTIME DESTINATION "bin")
|
||||
else ()
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION lib)
|
||||
if (PORTABLE)
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION "bin")
|
||||
else ()
|
||||
install(TARGETS "libopenrct2" LIBRARY DESTINATION "lib")
|
||||
endif ()
|
||||
install(TARGETS "openrct2" RUNTIME DESTINATION bin)
|
||||
endif ()
|
||||
install(TARGETS "openrct2" RUNTIME DESTINATION "bin")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/g2.dat" DESTINATION "share/openrct2")
|
||||
install(DIRECTORY "data/" DESTINATION "share/openrct2")
|
||||
install(FILES ${DOC_FILES} DESTINATION "share/doc/openrct2")
|
||||
|
|
|
@ -75,6 +75,11 @@ if (WIN32)
|
|||
# tell it that it is
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=1")
|
||||
endif ()
|
||||
|
||||
if (PORTABLE)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${TARGET_M}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 ${TARGET_M}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TARGET_M}")
|
||||
|
|
Loading…
Reference in a new issue