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

Add SailfishOS support #117

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SRC := $(LOCAL_PATH)/oxygine/src/oxygine

LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(SRC)/closure/*.cpp) \
$(wildcard $(SRC)/closure/*.cpp$(TARGET_ARCH_ABI)) \
$(wildcard $(SRC)/core/*.cpp) \
$(wildcard $(SRC)/math/*.cpp) \
$(wildcard $(SRC)/actor/*.cpp) \
Expand Down
1 change: 1 addition & 0 deletions examples/Demo/proj.android/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -std=c++11
APP_ABI := armeabi-v7a
APP_PLATFORM := android-8
27 changes: 27 additions & 0 deletions examples/Demo/proj.sfos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required (VERSION 2.6)
project (Demo)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(Demo ../src/Counter.cpp ../src/example.cpp ../src/main.cpp ../src/test.cpp ../src/Counter.h ../src/TestAlphaHitTest.h ../src/TestBox9Sprite.h ../src/TestClipRect.h ../src/TestColorFont.h ../src/TestCounter.h ../src/TestDrag.h ../src/TestEdges.h ../src/TestHttp.h ../src/TestInputText.h ../src/TestManageRes.h ../src/TestMask.h ../src/TestPerf.h ../src/TestPolygon.h ../src/TestProgressBar.h ../src/TestRender2Texture.h ../src/TestSignedDistanceFont.h ../src/TestSliding.h ../src/TestTexel2Pixel.h ../src/TestText.h ../src/TestTextureFormat.h ../src/TestTouches.h ../src/TestTweenPostProcessing.h ../src/TestTweenShine.h ../src/TestTweenText.h ../src/TestTweens.h ../src/TestUserShader.h ../src/TestUserShader2.h ../src/example.h ../src/test.h )
target_link_libraries(Demo ${OXYGINE_CORE_LIBS})



if (WIN32) #disable console mode for VC++
set_target_properties(Demo PROPERTIES WIN32_EXECUTABLE TRUE)
endif(WIN32)



if (EMSCRIPTEN)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 --memory-init-file 0 -s TOTAL_MEMORY=50331648")
em_link_pre_js(Demo ${OXYGINE_JS_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/data.js)
endif(EMSCRIPTEN)
9 changes: 9 additions & 0 deletions examples/Demo/proj.sfos/build_emsc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc
cd build_emsc
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
9 changes: 9 additions & 0 deletions examples/Demo/proj.sfos/build_emsc_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc_release
cd build_emsc_release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
16 changes: 16 additions & 0 deletions examples/Demo/proj.sfos/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

mkdir build
cd build

#generate cmake project in the "build" folder
cmake ..

#build it
make

#move to working data folder with resources
cd ../../data

#run executable
./../proj.cmake/build/Demo
35 changes: 35 additions & 0 deletions examples/DemoBox2D/proj.sfos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required (VERSION 2.6)
project (DemoBox2D)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

file(GLOB_RECURSE BOX2DSRC
../box2d/*.cpp
../box2d/*.h)

set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(DemoBox2D ${BOX2DSRC} ../src/Box2DDebugDraw.cpp ../src/main.cpp ../src/example.cpp ../src/Box2DDebugDraw.h ../src/example.h )
source_group(box2d FILES ${BOX2DSRC})
include_directories(../box2d)

target_link_libraries(DemoBox2D ${OXYGINE_CORE_LIBS})




if (WIN32) #disable console mode for VC++
set_target_properties(DemoBox2D PROPERTIES WIN32_EXECUTABLE TRUE)
endif(WIN32)



if (EMSCRIPTEN)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 --memory-init-file 0 -s TOTAL_MEMORY=50331648")
em_link_pre_js(DemoBox2D ${OXYGINE_JS_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/data.js)
endif(EMSCRIPTEN)
9 changes: 9 additions & 0 deletions examples/DemoBox2D/proj.sfos/build_emsc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc
cd build_emsc
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
9 changes: 9 additions & 0 deletions examples/DemoBox2D/proj.sfos/build_emsc_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc_release
cd build_emsc_release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
16 changes: 16 additions & 0 deletions examples/DemoBox2D/proj.sfos/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

mkdir build
cd build

#generate cmake project in the "build" folder
cmake ..

#build it
make

#move to working data folder with resources
cd ../../data

#run executable
./../proj.cmake/build/DemoBox2D
27 changes: 27 additions & 0 deletions examples/Game/part1/proj.sfos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required (VERSION 2.6)
project (GamePart1)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(GamePart1 ../src/Game.cpp ../src/Joystick.cpp ../src/Player.cpp ../src/Unit.cpp ../src/example.cpp ../src/main.cpp ../src/res.cpp ../src/Game.h ../src/Joystick.h ../src/Player.h ../src/Unit.h ../src/example.h ../src/res.h )
target_link_libraries(GamePart1 ${OXYGINE_CORE_LIBS})



if (WIN32) #disable console mode for VC++
set_target_properties(GamePart1 PROPERTIES WIN32_EXECUTABLE TRUE)
endif(WIN32)



if (EMSCRIPTEN)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 --memory-init-file 0 -s TOTAL_MEMORY=50331648")
em_link_pre_js(GamePart1 ${OXYGINE_JS_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/data.js)
endif(EMSCRIPTEN)
9 changes: 9 additions & 0 deletions examples/Game/part1/proj.sfos/build_emsc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc
cd build_emsc
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
9 changes: 9 additions & 0 deletions examples/Game/part1/proj.sfos/build_emsc_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc_release
cd build_emsc_release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
16 changes: 16 additions & 0 deletions examples/Game/part1/proj.sfos/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

mkdir build
cd build

#generate cmake project in the "build" folder
cmake ..

#build it
make

#move to working data folder with resources
cd ../../data

#run executable
./../proj.cmake/build/GamePart1
27 changes: 27 additions & 0 deletions examples/Game/part2/proj.sfos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required (VERSION 2.6)
project (GamePart2)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(GamePart2 ../src/Enemy.cpp ../src/Game.cpp ../src/Joystick.cpp ../src/Player.cpp ../src/Rocket.cpp ../src/Unit.cpp ../src/example.cpp ../src/main.cpp ../src/res.cpp ../src/Enemy.h ../src/Game.h ../src/Joystick.h ../src/Player.h ../src/Rocket.h ../src/Unit.h ../src/example.h ../src/res.h )
target_link_libraries(GamePart2 ${OXYGINE_CORE_LIBS})



if (WIN32) #disable console mode for VC++
set_target_properties(GamePart2 PROPERTIES WIN32_EXECUTABLE TRUE)
endif(WIN32)



if (EMSCRIPTEN)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 --memory-init-file 0 -s TOTAL_MEMORY=50331648")
em_link_pre_js(GamePart2 ${OXYGINE_JS_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/data.js)
endif(EMSCRIPTEN)
9 changes: 9 additions & 0 deletions examples/Game/part2/proj.sfos/build_emsc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc
cd build_emsc
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
9 changes: 9 additions & 0 deletions examples/Game/part2/proj.sfos/build_emsc_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc_release
cd build_emsc_release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
16 changes: 16 additions & 0 deletions examples/Game/part2/proj.sfos/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

mkdir build
cd build

#generate cmake project in the "build" folder
cmake ..

#build it
make

#move to working data folder with resources
cd ../../data

#run executable
./../proj.cmake/build/GamePart2
27 changes: 27 additions & 0 deletions examples/Game/part3/proj.sfos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required (VERSION 2.6)
project (GamePart3)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(GamePart3 ../src/Enemy.cpp ../src/Game.cpp ../src/GameScene.cpp ../src/Joystick.cpp ../src/MainMenuScene.cpp ../src/MyButton.cpp ../src/Player.cpp ../src/Rocket.cpp ../src/Scene.cpp ../src/Unit.cpp ../src/example.cpp ../src/main.cpp ../src/res.cpp ../src/Enemy.h ../src/Game.h ../src/GameScene.h ../src/Joystick.h ../src/MainMenuScene.h ../src/MyButton.h ../src/Player.h ../src/Rocket.h ../src/Scene.h ../src/Unit.h ../src/example.h ../src/res.h )
target_link_libraries(GamePart3 ${OXYGINE_CORE_LIBS})



if (WIN32) #disable console mode for VC++
set_target_properties(GamePart3 PROPERTIES WIN32_EXECUTABLE TRUE)
endif(WIN32)



if (EMSCRIPTEN)
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_EXIT_RUNTIME=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 --memory-init-file 0 -s TOTAL_MEMORY=50331648")
em_link_pre_js(GamePart3 ${OXYGINE_JS_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/data.js)
endif(EMSCRIPTEN)
9 changes: 9 additions & 0 deletions examples/Game/part3/proj.sfos/build_emsc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc
cd build_emsc
cmake -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
9 changes: 9 additions & 0 deletions examples/Game/part3/proj.sfos/build_emsc_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
call emsdk activate

python ../../../..//tools/others/embed_folder_js.py -s ../data

mkdir build_emsc_release
cd build_emsc_release
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="%EMSCRIPTEN%/cmake/Modules/Platform/emscripten.cmake" -G"Unix Makefiles" ..
make
cd ..
16 changes: 16 additions & 0 deletions examples/Game/part3/proj.sfos/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

mkdir build
cd build

#generate cmake project in the "build" folder
cmake ..

#build it
make

#move to working data folder with resources
cd ../../data

#run executable
./../proj.cmake/build/GamePart3
3 changes: 2 additions & 1 deletion examples/Game/part4/proj.cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
cmake_minimum_required (VERSION 2.6)
project (GamePart4)

add_definitions( -D__SAILFISHOS__=1 )
add_subdirectory(../../../../ oxygine-framework)
add_definitions(${OXYGINE_DEFINITIONS})
include_directories(${OXYGINE_INCLUDE_DIRS})
link_directories(${OXYGINE_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-lGLESv2 ${CMAKE_CXX_FLAGS} ${OXYGINE_CXX_FLAGS}")

add_executable(GamePart4 ../src/Enemy.cpp ../src/Game.cpp ../src/GameMenu.cpp ../src/GameScene.cpp ../src/Joystick.cpp ../src/MainMenuScene.cpp ../src/MyButton.cpp ../src/Player.cpp ../src/Rocket.cpp ../src/Scene.cpp ../src/Unit.cpp ../src/example.cpp ../src/main.cpp ../src/res.cpp ../src/Enemy.h ../src/Game.h ../src/GameMenu.h ../src/GameScene.h ../src/Joystick.h ../src/MainMenuScene.h ../src/MyButton.h ../src/Player.h ../src/Rocket.h ../src/Scene.h ../src/Unit.h ../src/example.h ../src/res.h )
target_link_libraries(GamePart4 ${OXYGINE_CORE_LIBS})
Expand Down
Loading