Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SDL2 dependencies: Phase 1 #5458

Merged
merged 76 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
9c904db
Add UI src project
IntelOrca Mar 24, 2017
19aafc4
Move drawing engine implementation code to openrct2-ui
IntelOrca Mar 24, 2017
c7b66ab
Fix includes for moved files
IntelOrca Mar 24, 2017
bf37498
Allow drawing engine registration via context interfaces
IntelOrca Mar 24, 2017
006a76c
Refactor registration of drawing engines
IntelOrca Mar 24, 2017
5c59b74
Add new CLI and UI builds for non Windows platforms
IntelOrca Mar 24, 2017
fedb891
Create new CMake project for libopenrct2
IntelOrca Mar 24, 2017
6446342
Update cmakelists for lib and cli
IntelOrca Mar 24, 2017
f856510
Get openrct2-cli linking successfully
IntelOrca Mar 24, 2017
8978036
Add openrct2-ui cmake project
IntelOrca Mar 24, 2017
c7b1fee
Add back most of the cmake options
IntelOrca Mar 25, 2017
06bba09
Fix various issues with the cmake projects
IntelOrca Mar 25, 2017
1018287
Invert Context and UiContext dependencies
IntelOrca Mar 25, 2017
6375e01
Add VS project for CLI only build
IntelOrca Mar 25, 2017
5885cb6
Start moving window logic to UI project
IntelOrca Mar 25, 2017
f736e8f
Move more platform code to UiContext
IntelOrca Mar 25, 2017
9d24e47
Fix build
IntelOrca Mar 26, 2017
7163973
Start moving code from OpenRCT2 to Context
IntelOrca Mar 26, 2017
bd9839f
Get the game working
IntelOrca Mar 26, 2017
175606a
Create new audio context interface
IntelOrca Mar 26, 2017
d206d18
Move audio code to UI project
IntelOrca Mar 28, 2017
e426c70
Get moved audio code linking
IntelOrca Mar 29, 2017
0440c3d
Clean up audio.cpp
IntelOrca Mar 29, 2017
a020a9f
Fix premature deletion of platform context
IntelOrca Mar 29, 2017
3fcd42f
Move more window code to UiContext
IntelOrca Apr 1, 2017
cf0dcb4
Refactor file / directory dialogs to UiContext
IntelOrca Apr 1, 2017
08ae742
Remove a few more SDL calls from core library
IntelOrca Apr 1, 2017
d45a502
Replace SDL with normal fopen in cmdline_sprite.c
IntelOrca Apr 1, 2017
e2a7189
Do not use SDL_Colour for gPalette
IntelOrca Apr 2, 2017
fc19b57
Fix build after rebase
IntelOrca May 6, 2017
50197f0
Fix boolean warning
IntelOrca May 6, 2017
e133585
Fix 32-bit build
IntelOrca May 6, 2017
423028d
Fix some warnings with clang and GCC
janisozaur May 6, 2017
98d59cc
Fix Linux build errors
IntelOrca May 6, 2017
e670a38
Add cmath include to AudioMixer for std::pow
janisozaur May 7, 2017
23a314d
Convert tabs to spaces for test cmakelists
IntelOrca May 8, 2017
1f8f354
Update root cmake and enable tests
IntelOrca May 8, 2017
a4c0602
Add install target to cmake
IntelOrca May 8, 2017
82288f9
Add cmake for testpaint
IntelOrca May 8, 2017
41f376f
Add final to implementations
IntelOrca May 8, 2017
c394a99
Update install target and export library so
IntelOrca May 8, 2017
0019905
Add SDL2 include to test cmake
IntelOrca May 8, 2017
f1a8b32
Prevent SDL_INIT when the game does not need to launch
IntelOrca May 8, 2017
3fa7643
Fix string errors and warnings
IntelOrca May 8, 2017
e8ec7ee
Implement building of libopenrct2 and OpenRCT-UI for macOS
rwjuk May 11, 2017
c71fc2b
Remove test code
rwjuk May 12, 2017
6377138
Remove whitespace in UiContext.cpp
rwjuk May 12, 2017
f7f5cb7
Add macOS target for CLI build
rwjuk May 12, 2017
ee9aa55
Fix more warnings
IntelOrca May 13, 2017
90fbb29
Tidy up Xcode project
marijnvdwerf May 13, 2017
7608f7f
Remove generated main.cpp
marijnvdwerf May 14, 2017
3a194f3
Fix macOS compilation of library
marijnvdwerf May 14, 2017
52552a9
Work on fixing openrct2-gui compilation
marijnvdwerf May 14, 2017
898ffdb
Fix #5487: Crash on deleting text
rwjuk May 17, 2017
999a467
Add SetKeysPressed() function to UiContext
rwjuk May 17, 2017
aa51515
Fix formatting
rwjuk May 17, 2017
d4e5514
Tabs-to-spaces on UiContext.macOS.mm
rwjuk May 17, 2017
e54bed7
Remove stray spaces in header
rwjuk May 17, 2017
69feeaf
Clean up Xcode project post-rebase
rwjuk May 19, 2017
3ebf5be
Fix mingw cmake
IntelOrca May 20, 2017
f998172
Fix IME text input
IntelOrca May 21, 2017
7a59eef
Fix cmake for OpenRCT2-UI on macOS
rwjuk May 23, 2017
1eb5ed0
Update vscode debug configuration
IntelOrca May 27, 2017
e313568
Initialise UiContext input fields
IntelOrca May 27, 2017
a15a226
Fix zenity dialog logic
IntelOrca May 27, 2017
4932537
Fix kdialog implementation
IntelOrca May 27, 2017
3ca1b48
Open the game window on the last remembered display
IntelOrca May 27, 2017
61228fc
Add all files filter
IntelOrca May 28, 2017
615580d
Don't check for fontconfig on macOS
marijnvdwerf May 29, 2017
a43ee2b
Fix copyright year and comment
Gymnasiast May 29, 2017
de9adf5
Allow building headless version as a separate target
janisozaur May 29, 2017
8cb24b2
Add headless builds to travis configurations
janisozaur May 29, 2017
5a93b67
Update changelog.txt
janisozaur May 29, 2017
1e550e9
Create portable builds
IntelOrca May 30, 2017
25e50bf
Set CMAKE_INSTALL_RPATH before adding executables.
rwjuk May 31, 2017
8d3b7f8
Set CMAKE_INSTALL_RPATH to $ORIGIN on CLI build
rwjuk May 31, 2017
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
else()
install(TARGETS "libopenrct2" LIBRARY DESTINATION lib)
endif()
install(TARGETS "openrct2" RUNTIME DESTINATION bin)
install(TARGETS "libopenrct2" RUNTIME DESTINATION "bin")
else ()
if (PORTABLE)
install(TARGETS "libopenrct2" LIBRARY DESTINATION "bin")
else ()
install(TARGETS "libopenrct2" LIBRARY DESTINATION "lib")
endif ()
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")
Expand Down
5 changes: 5 additions & 0 deletions src/openrct2-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this get interpreted as "fill with contents of variable named 'ORIGIN'?

Copy link
Contributor Author

@IntelOrca IntelOrca May 31, 2017

Choose a reason for hiding this comment

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

CMAKE uses ${...} for variables and $ENV{...} for environment variables. I think this is saw on various internet pages for how to do it in cmake. It works when I build it myself.

Copy link
Contributor

Choose a reason for hiding this comment

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

set(CMAKE_INSTALL_RPATH "$ORIGIN") needs to go before add_executable() for it to work I think.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the other frontend also receive the same treatment?

Copy link
Contributor

Choose a reason for hiding this comment

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

@janisozaur Derp. Yes, set(CMAKE_INSTALL_RPATH "$ORIGIN") added for the CLI build.

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}")
Expand Down