ShiVa Developer Forum • View topic - Blackberry Target - CPP Projects Compilation
 

Blackberry Target - CPP Projects Compilation

BlackBerry Tablet OS and BlackBerry 10

Blackberry Target - CPP Projects Compilation

Postby yohanip » 2013-12-23 11:59

Hi! i am using the new Shiva3d Ver 1.9.2.0 and ShiVa Authoring Tool 1.4.0.0

Trying to play "Navigation Demo" on my BB Playbook, generating the bar was a snap if Lua is not converted to C++

I would like to test the performance if using Lua to C++ files, therefore i generated projects instead of the bar package

Because the authoring tool did not provide "Native Sources Panel", i could not add the C++ sources directly to Authoring tool. Therefore i'm taking another route, instead of generate package, i request Authoring Tool to generate "projects".

Made a little change to the makefile generated because the makefile produced from the Authoring Tool do not compile the AIModel's cpp files

My next step was promptly copy pasting the command Authoring Tool told me, 1)executing the make command, 2) making the bar using nativepackager, and the 3) install process all through the cygwin shell prompt, all went well..

but the application only displays "blank screen", i assume that the cpp ai models onInit was never invoked.. :oops:

Please help, how to setup the "Navigation" demo (STK + CPP sources) so that it would render and call the aimodels correctly

Thanks :D

Btw, this 1.9.2 release Rocks!
yohanip
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: 2012-10-09 12:31

Re: Blackberry Target - CPP Projects Compilation

Postby _geo_ » 2015-05-05 14:41

Hi,

this is the cpp makefile for OS10 which we are using. Hope it helps.
Code: Select all
#################################################################
#   S3DEngine Makefile for BlackBerry
#################################################################

PROJECT_ROOT                  = [PROJECT_PATH]
BLACKBERRY_NDK_ROOT             = [OS10_NDK]

CONFIGURATION_TEMP_DIR            = obj
CONFIGURATION_TEMP_DIR_EngineMain   = $(CONFIGURATION_TEMP_DIR)
CONFIGURATION_TEMP_DIR_AIModels     = $(CONFIGURATION_TEMP_DIR)/AIModels
SRCROOT                             = .
BUILT_PRODUCTS_DIR                  = .
PRODUCT_NAME                        = [clone_camelized]
GLES_VERSION                  = 2
PREFIX_HEADER                       = S3DX/S3DXAIModel.h

# Lua:
# ENGINE_LIBRARY             = S3DClient_BlackBerry_ndk10_arm_v7_GLES$(GLES_VERSION).a

# Cpp:
ENGINE_LIBRARY             = S3DClientNative_BlackBerry_ndk10_arm_v7_GLES$(GLES_VERSION).a


#################################################################

# OS 2
#export QNX_TARGET               = $(BLACKBERRY_NDK_ROOT)/target/qnx6
#export QNX_TARGET_OVERRIDE         = $(BLACKBERRY_NDK_ROOT)/target/target-override
#export QNX_HOST                   = $(BLACKBERRY_NDK_ROOT)/host/win32/x86
#export QCC_CONF_PATH             = $(QNX_HOST)/etc/qcc/gcc
#export AS                     = qcc -V4.41.2,gcc_ntoarmv7le_cpp
#export CC                     = qcc -V4.41.2,gcc_ntoarmv7le
#export CXX                     = qcc -V4.41.2,gcc_ntoarmv7le_cpp
#export LD                      = qcc -V4.41.2,gcc_ntoarmv7le_cpp
#export MAKEFLAGS                = -I$(QNX_TARGET)/usr/include


# OS 10
export QNX_TARGET               = $(BLACKBERRY_NDK_ROOT)/target_10_2_0_1155/qnx6
export QNX_TARGET_OVERRIDE         = $(BLACKBERRY_NDK_ROOT)/target_10_2_0_1155/target-override
export QNX_HOST                   = $(BLACKBERRY_NDK_ROOT)/host_10_2_0_15/win32/x86
export QCC_CONF_PATH             = $(QNX_HOST)/etc/qcc/gcc
export AS                     = qcc -V4.6.3,gcc_ntoarmv7le_cpp
#export CC                     = qcc -V4.6.3,gcc_ntoarmv7le
export CXX                     = qcc -V4.6.3,gcc_ntoarmv7le_cpp
export LD                      = qcc -V4.6.3,gcc_ntoarmv7le_cpp

#################################################################
ifeq ($(GLES_VERSION), 2)
    GLES_LIBRARIES               = -lEGL -lGLESv2
else
    GLES_LIBRARIES               = -lEGL -lGLESv1_CM
endif
#################################################################
USER_PLUGINS      = "$(PROJECT_ROOT)/Plugins/com.starkapps.text/Contents/BlackBerry/StarkApps_Text_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.starkapps.sound/Contents/BlackBerry/StarkApps_Sound_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.starkapps.data/Contents/BlackBerry/StarkApps_Data_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.modernalchemists.mazlib/Contents/BlackBerry/Modern_Alchemists_zlib_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.starkapps.utility/Contents/BlackBerry/StarkApps_Utility_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.starkapps.activity/Contents/BlackBerry/StarkApps_Activity_BlackBerry.a" "$(PROJECT_ROOT)/Plugins/com.starkapps.statistics/Contents/BlackBerry/StarkApps_Statistics_BlackBerry.a"
# Modified, removed -lscorelooplib for OS 10 because it�s not used and causes errors
USER_LIBRARIES      =

#################################################################
SOURCES_EngineMain   = S3DEngine_BlackBerry.cpp

#################################################################

# Lua:
# SOURCES_AIModels   = \

# Cpp:
SOURCES_AIModels   = single.cpp

#################################################################
#  Compiler executables
#
CC               = $(QNX_HOST)/usr/bin/qcc -Vgcc_ntoarmv7
CPP              = $(QNX_HOST)/usr/bin/qcc -Vgcc_ntoarmv7 -lang-c++
LD               = $(QNX_HOST)/usr/bin/qcc -Vgcc_ntoarmv7
AR                  = $(QNX_HOST)/usr/bin/ntoarmv7-ar.exe
STRIP               = $(QNX_HOST)/usr/bin/ntoarmv7-strip.exe

####################################################################"
#  Compiler flags
#
COMMONFLAGS         = -O2 -g0 -DNDEBUG -D__BLACKBERRY__ -D_QNX_SOURCE -DHAVE_STDINT_H -DHAVE_ALLOCA_H -W -fno-strict-aliasing -fstack-protector-all -D_FORTIFY_SOURCE=2 -EL -DVARIANT_v7 -DVARIANT_le -DBUILDENV_qss
CFLAGS              = $(COMMONFLAGS)
CPPFLAGS            = $(COMMONFLAGS) -fno-rtti -fexceptions
INCLUDES             = -I$(SRCROOT) -I$(QNX_TARGET)/usr/include -I$(QNX_TARGET)/usr/include/cpp/c -I$(QNX_TARGET_OVERRIDE)/usr/include

#################################################################
#  Linker flags
#
LDPATH            = -L. \
                 -L$(QNX_TARGET_OVERRIDE)/armle-v7/lib \
                 -L$(QNX_TARGET_OVERRIDE)/armle-v7/usr/lib \
                 -L$(QNX_TARGET)/armle-v7/lib \
                 -L$(QNX_TARGET)/armle-v7/usr/lib \
                 -Wl,--rpath-link . \
                 -Wl,--rpath-link $(QNX_TARGET_OVERRIDE)/armle-v7/lib \
                 -Wl,--rpath-link $(QNX_TARGET_OVERRIDE)/armle-v7/usr/lib \
                 -Wl,--rpath-link $(QNX_TARGET)/armle-v7/lib \
                 -Wl,--rpath-link $(QNX_TARGET)/armle-v7/usr/lib
LDFLAGS             = -Wl,--no-keep-memory -Wl,-z,relro -Wl,-z,now -EL
LDLIBS             = $(ENGINE_LIBRARY) -Wl,--whole-archive $(USER_PLUGINS) -Wl,--no-whole-archive -L$(CONFIGURATION_TEMP_DIR) $(LDPATH) -lbps -lpps -lmmrndclient -lstrm -lscreen $(GLES_LIBRARIES) $(USER_LIBRARIES) -lOpenAL -lasound -lsocket -lcpp -lm
STRIPFLAGS          = -s -w -K=*_Get*Map -K=*_GetPlugin -K=*_AutoRegisterSingleton

####################################################################"
#  ...
#
OBJECTS_EngineMain  =\
   $(patsubst %.c,%.o,$(filter %.c,$(SOURCES_EngineMain))) \
   $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES_EngineMain))) \
   $(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES_EngineMain)))

OBJECTS_AIModels  =\
   $(patsubst %.c,%.o,$(filter %.c,$(SOURCES_AIModels))) \
   $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES_AIModels))) \
   $(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES_AIModels)))

OBJECTS_ABS_EngineMain  = $(addprefix $(CONFIGURATION_TEMP_DIR_EngineMain)/,$(OBJECTS_EngineMain))
OBJECTS_ABS_AIModels    = $(addprefix $(CONFIGURATION_TEMP_DIR_AIModels)/,$(OBJECTS_AIModels))
APP_ABS                 = $(BUILT_PRODUCTS_DIR)
PRODUCT_ABS            = $(APP_ABS)/$(PRODUCT_NAME).bin

####################################################################"
#  Targets
#
all: $(PRODUCT_ABS)

$(PRODUCT_ABS): $(OBJECTS_ABS_EngineMain) $(OBJECTS_ABS_AIModels)
   mkdir -p $(BUILT_PRODUCTS_DIR)
   $(LD)  -o $(PRODUCT_ABS) $(OBJECTS_ABS_EngineMain) $(OBJECTS_ABS_AIModels) $(LDFLAGS) $(LDLIBS)
   $(STRIP) $(STRIPFLAGS) $(PRODUCT_ABS)
   
$(CONFIGURATION_TEMP_DIR_EngineMain)/%.o: $(SRCROOT)/%.c
   mkdir -p `dirname $@`
   $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

$(CONFIGURATION_TEMP_DIR_EngineMain)/%.o: $(SRCROOT)/%.cpp
   mkdir -p `dirname $@`
   $(CPP) $(CPPFLAGS) $(INCLUDES) -c $< -o $@

$(CONFIGURATION_TEMP_DIR_AIModels)/%.o: $(SRCROOT)/AIModels/%.c
   mkdir -p `dirname $@`
   $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

$(CONFIGURATION_TEMP_DIR_AIModels)/%.o: $(SRCROOT)/AIModels/%.cpp $(PREFIX_HEADER).gch
   mkdir -p `dirname $@`
   $(CPP) $(CPPFLAGS) $(INCLUDES) -c $< -o $@

$(PREFIX_HEADER).gch : $(PREFIX_HEADER)
   mkdir -p `dirname $@`
   $(CPP) $(CPPFLAGS) $(INCLUDES) -c $< -o $@


#################################################################
clean:
   rm -f $(PRODUCT_ABS)
   rm -rf $(CONFIGURATION_TEMP_DIR)
prepare:
install:
fly yes, land no | Modern Alchemists | Blog | MASH | MATWEEN-AI
_geo_
Gold Boarder
Gold Boarder
 
Posts: 201
Joined: 2010-10-30 14:32
Location: Austria


Return to BlackBerry

Who is online

Users browsing this forum: No registered users and 1 guest

cron