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

iOS build #1124

Open
wants to merge 170 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
995fc19
Add files via upload
OLFDB Feb 20, 2019
644fc22
Add:gui/internal
OLFDB Feb 21, 2019
f277c49
Indent
OLFDB Feb 21, 2019
f0c7fd7
Indent
OLFDB Feb 21, 2019
38fe29f
Add files via upload
OLFDB Feb 21, 2019
f666165
Indent
OLFDB Feb 21, 2019
4862370
Indent
OLFDB Feb 21, 2019
5de0b44
Indent
OLFDB Feb 21, 2019
3459120
Indent
OLFDB Feb 21, 2019
e881f47
FIX:DTD <navit> to not show errors in XML editors
OLFDB Feb 23, 2019
495b4cf
Merge pull request #1 from navit-gps/trunk
OLFDB Feb 24, 2019
50eb35e
FIX: Removed duplicate comma
OLFDB Feb 24, 2019
43c649d
FIX:WIN32 build with gtk_drawing_area
OLFDB Feb 26, 2019
e9fb7a2
FIX:undefined symbol errors for cairo
OLFDB Feb 26, 2019
0f4282f
FIX:Undo changes
OLFDB Feb 27, 2019
6b84e47
FIX:Use cairo instead of pangocairo
OLFDB Feb 27, 2019
9563675
Feature: Support USERPROFILE folder for Windows
OLFDB Mar 1, 2019
1c0274a
Merge pull request #2 from navit-gps/trunk
OLFDB Mar 3, 2019
d3ad426
Indent
OLFDB Mar 3, 2019
60e98a2
indent
OLFDB Mar 3, 2019
a1d6038
indent
OLFDB Mar 3, 2019
400ea1b
indent
OLFDB Mar 3, 2019
0f15a21
indent
OLFDB Mar 3, 2019
207ea59
indent
OLFDB Mar 3, 2019
4365ed2
Rework:USERPROFILE for Windows
OLFDB Mar 5, 2019
5d2b87f
FIX:build for macos
OLFDB Mar 12, 2019
503d1c3
Merge pull request #3 from navit-gps/trunk
OLFDB Mar 18, 2019
d206aad
Merge pull request #4 from navit-gps/trunk
OLFDB Apr 4, 2019
78c3cd8
FIX:Conditional apple build
OLFDB Apr 12, 2019
985fa38
FIX:typo
OLFDB Apr 12, 2019
6444f38
Using HAVE_API_WIN32 instead of HAVE_API_WIN32_BASE (Both WinCE and W…
lains Apr 29, 2019
9b40328
Update config.yml
OLFDB Jul 6, 2019
399985a
Revert "Update config.yml"
OLFDB Jul 7, 2019
ba98bee
Revert "Update config.yml"
OLFDB Jul 7, 2019
68f3dd8
Merge branch 'trunk' of https://github.com/OLFDB/navit into trunk
OLFDB Jul 7, 2019
5e76e7d
Revert "FIX:Use cairo instead of pangocairo"
OLFDB Jul 7, 2019
b0c2a83
revert changes
OLFDB Jul 7, 2019
17ecfcd
repair
Jul 7, 2019
b2de863
Revert "FIX: Removed duplicate comma"
Jul 7, 2019
907c5fb
Revert "FIX:DTD <navit> to not show errors in XML editors"
Jul 7, 2019
76cbd23
Revert "FIX:WIN32 build with gtk_drawing_area"
Jul 7, 2019
67961fe
Disable sanity check for permanentrestrictions folder
OLFDB Jul 27, 2019
9c5a187
Merge branch 'trunk' into trunk
pgrandin Aug 16, 2019
540d93a
Merge remote-tracking branch 'upstream/trunk' into trunk
Sep 25, 2019
b41d652
Minor revert on blank line
Sep 25, 2019
d670c8c
Update update_download_center.sh
OLFDB Mar 5, 2021
e34ee3b
Update config.yml
OLFDB Mar 5, 2021
ae8e847
Update ci_sanity_checks.sh
OLFDB Apr 3, 2021
7775f77
Merge pull request #10 from navit-gps/trunk
OLFDB Apr 3, 2021
71493b4
Update osm.c
OLFDB Apr 3, 2021
12c9200
Update osm.c
OLFDB Apr 3, 2021
c3c8c5a
Disable debug output
OLFDB Apr 3, 2021
fc9a672
Update navit_shipped.xml
OLFDB Apr 3, 2021
6af3dbc
Merge branch 'trunk' into trucknavigation
OLFDB Apr 3, 2021
baeef1c
Update osm.c
OLFDB Apr 3, 2021
3a397da
Update osm.c
OLFDB Apr 3, 2021
9fc0e74
Add boundary=low_emission_zone to binfile map.
metalstrolch Apr 3, 2021
3998c8d
Update osm.c
OLFDB Apr 3, 2021
e9b933e
Merge branch 'trunk' into trucknavigation
OLFDB Apr 3, 2021
f6a1771
Fix multi polygon detection
metalstrolch Apr 3, 2021
2f251b2
Update navit_layout_car_shipped.xml
OLFDB Apr 4, 2021
e98b308
Update osm.c
OLFDB Apr 4, 2021
f00c2f8
Update osm_xml.c
OLFDB Apr 4, 2021
f1a2d28
Update osm.c
OLFDB Apr 4, 2021
6e109d2
Update navit_layout_car_dark_shipped.xml
OLFDB Apr 4, 2021
a95c73b
enhanced conversion functions
OLFDB Apr 4, 2021
8a87709
Merge branch 'trucknavigation' of https://github.com/OLFDB/navit into…
OLFDB Apr 4, 2021
6dd140a
handle onditional speed limits
OLFDB Apr 10, 2021
d8bb86c
gui internal to change vehicle dimensions. Store dimensions in XML fi…
OLFDB Apr 24, 2021
3971819
Merge branch 'trunk' into trucknavigation
OLFDB Apr 24, 2021
5222500
Merge branch 'trunk' into trucknavigation
OLFDB Apr 25, 2021
67a33a2
Merge pull request #11 from OLFDB/trucknavigation
OLFDB Apr 26, 2021
9e3e9fc
Added demo vehicle
OLFDB May 29, 2021
019ec0e
Request location authorization from the user on request
OLFDB May 29, 2021
5785ff0
Handle location authorization requests, applied astyle
OLFDB May 29, 2021
fdc4363
Handle location authorization requests, applied astyle
OLFDB May 29, 2021
fa3130b
Fix iOS build
OLFDB May 29, 2021
e1808a2
Fix iOS build, astyle applied
OLFDB May 29, 2021
14e0a06
Fixed iOS build
OLFDB May 29, 2021
2e01498
Fixed iOS build
OLFDB May 29, 2021
3de6a8a
Fixed iOS build
OLFDB May 29, 2021
c90a03e
Fixed iOS build
OLFDB May 29, 2021
e5fa578
Fixed iOS build
OLFDB May 29, 2021
88f9c72
Fixed iOS build, astyle applied
OLFDB May 29, 2021
cc321f0
Fixed iOS build, astyle applied
OLFDB May 29, 2021
d7d34a0
Added implementation, astyle applied
OLFDB May 29, 2021
569f3a7
Added attr_vehicle_request_location_authorization to be able to reque…
OLFDB May 29, 2021
aeb2435
Fix for iOS build, astyle applied
OLFDB May 29, 2021
646ccb1
Fixes for iOS build, astyle applied
OLFDB May 29, 2021
310da33
Fixes for iOS build, astyle applied
OLFDB May 29, 2021
ea0e08b
Fixes for iOS build, astyle applied
OLFDB May 29, 2021
2f45274
Added attr_vehicle_request_location_authorization to be able to reque…
OLFDB May 29, 2021
dc00070
Fixes for iOS build, astyle applied
OLFDB May 29, 2021
bf5f51f
New iOS build cmake file
OLFDB May 29, 2021
5e0c9f6
Added VSSpeechSynthesizer.m to module
OLFDB May 29, 2021
e91a350
Fixed iOS build
OLFDB May 29, 2021
5ca4413
Fixed iOS build
OLFDB May 29, 2021
9d691d8
astyle applied
OLFDB May 29, 2021
25c7378
Log disabled
OLFDB May 29, 2021
bb3dbfb
Discard attr_vehicle_request_location_authorization with no error
OLFDB May 29, 2021
d877d1c
Added NSLocationWhenInUseUsageDescription key
OLFDB May 29, 2021
3c08b42
Log disabled
OLFDB May 29, 2021
7515cb1
Repair the mess atype created...
OLFDB May 29, 2021
f49ae2f
Removed variable
OLFDB May 29, 2021
78970d6
Merge branch 'ios' of https://github.com/OLFDB/navit into HEAD
OLFDB May 29, 2021
a8c2b47
Repair the mess atype created...
OLFDB May 29, 2021
a78ccd1
Fixes after review
OLFDB May 30, 2021
bbd1319
Fixes after review
OLFDB May 30, 2021
b873491
Fixes after review
OLFDB May 30, 2021
325645c
Fixes after review
OLFDB May 30, 2021
fe4513c
Fixes after review
OLFDB May 30, 2021
3e6d0d5
Allow architecture to be set via -DIOS_ARCH= in commandline
OLFDB May 30, 2021
f9266df
Changes after review, iPad support
OLFDB May 30, 2021
24970c7
handle asset catalag
OLFDB Jun 6, 2021
c442d98
use of simulator
OLFDB Jun 6, 2021
101ba49
use of asset catalog, do not crop Default.png and Icon.png
OLFDB Jun 6, 2021
b53c474
Guide to build with Xcode for iOS
OLFDB Jun 6, 2021
b814bf7
use LaunchScreen, no status bar, supported orientations, CFBundleVers…
OLFDB Jun 6, 2021
db0beea
Changes after review
OLFDB Jun 6, 2021
b4770d0
not needed
OLFDB Jun 6, 2021
7bca23a
astyle
OLFDB Jun 6, 2021
4087bc2
astyle
OLFDB Jun 6, 2021
6cc9d0a
Fixed CoreText library linker directive
OLFDB Jun 6, 2021
f655c6a
changes to prevent include of gthreadprivate.h in start_real.c
OLFDB Jun 7, 2021
d88e977
generated icons, debug entries to find root cause for symbols not found
OLFDB Jun 10, 2021
38a43bb
sanity check issue
OLFDB Jun 10, 2021
8fc1a9a
Policy issue
OLFDB Jun 10, 2021
8e5b1c8
Improved speech for iPhone
OLFDB Jun 12, 2021
fe2fc27
Changes after review
OLFDB Jun 12, 2021
d2e539e
Improved rotation
OLFDB Jun 12, 2021
389d47b
astyle
OLFDB Jun 12, 2021
a05cb7e
adress warnings
OLFDB Jun 12, 2021
99d1d1a
pad, pinch, tap support
OLFDB Jun 18, 2021
1a2dcb8
Merge branch 'trunk' into ios
jkoan Jun 22, 2021
2d851ba
Rendering issues fixed
OLFDB Jun 26, 2021
e4d7c5a
Merge branch 'ios' of https://github.com/OLFDB/navit into ios
OLFDB Jun 26, 2021
e3056a1
astyle
OLFDB Jun 26, 2021
c3f5510
addressed a warning, removed a debug message
OLFDB Jun 27, 2021
3b7ae06
Changes for icon creation, added textures to bundle
OLFDB Jun 27, 2021
961daab
macos compatibility
OLFDB Jun 27, 2021
1ac3c9a
macos compatibility
OLFDB Jun 27, 2021
ccd49b8
add icons for ad-hoc deployment
OLFDB Jun 27, 2021
52fd7ee
astyle
OLFDB Jun 27, 2021
5fe2256
set iOS version for any build target
OLFDB Jul 26, 2021
fa9fa38
background processing, versioning, license text
OLFDB Jul 26, 2021
3c43196
display menu while in background, do not draw polygons with count of …
OLFDB Jul 26, 2021
0384757
maptool on macos
OLFDB Jul 26, 2021
a4a2f36
moved vehicle_request_location_authorization, added vehicle_is_select…
OLFDB Jul 26, 2021
abafe62
mark vehicle active/inactive when changing vehicles, added navit_stor…
OLFDB Jul 26, 2021
d2a1bd5
added prototype for navit_store_center(struct navit * this_)
OLFDB Jul 26, 2021
0c7d095
added prototype for (void)setHFPDelay:(double) delay
OLFDB Jul 26, 2021
8fc8d76
use a delay instead of silent annoucement for HFP connection establis…
OLFDB Jul 26, 2021
41ea250
setHFPdelay added
OLFDB Jul 26, 2021
6c23a7c
handle language="de"
OLFDB Jul 26, 2021
71a72c4
addressed an Xcode warning
OLFDB Jul 26, 2021
10ac9c6
support for attribute vehicle_is_selected
OLFDB Jul 26, 2021
50f9693
support for attribute vehicle_is_selected
OLFDB Jul 26, 2021
d9989cd
support background activity
OLFDB Jul 26, 2021
7ba5d8e
support position_valid attribute
OLFDB Jul 26, 2021
77e4f23
support new build system for Xcode, create launch images for iOS
OLFDB Jul 26, 2021
3aa2e2a
use git version for iOS only
OLFDB Jul 27, 2021
d24af52
Merge branch 'trunk' into ios
OLFDB Sep 19, 2021
c572c4f
merge trunk
OLFDB Oct 9, 2021
3b8f8a3
Merge branch 'navit-gps-trunk' into trunk
OLFDB Oct 9, 2021
1da3ccb
Merge pull request #14 from navit-gps/trunk
OLFDB Oct 9, 2021
4c69b68
merged trunk
OLFDB Mar 20, 2022
5d4bf2a
merge trunk
OLFDB Mar 20, 2022
4591018
Merge branch 'navit-gps-trunk' into trunk
OLFDB Mar 20, 2022
5973dc5
Merge branch 'ios' into trunk
OLFDB Mar 20, 2022
7acf706
Merge pull request #17 from OLFDB/trunk
OLFDB Mar 20, 2022
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
51 changes: 45 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,21 @@ endif(NOT HAVE_SNPRINTF)
CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES)
CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL)
CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
if (USE_UIKIT)
set(HAVE_SYS_TIME_H TRUE)
endif (USE_UIKIT)
CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
if (USE_UIKIT)
set(HAVE_GETOPT_H TRUE)
endif(USE_UIKIT)
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_SYMBOL_EXISTS(system stdlib.h HAVE_SYSTEM)
CHECK_SYMBOL_EXISTS(CreateProcess windows.h HAVE_CREATEPROCESS)
CHECK_SYMBOL_EXISTS(stpcpy string.h HAVE_STPCPY)
if (USE_UIKIT)
set(HAVE_STPCPY TRUE)
endif(USE_UIKIT)
CHECK_FUNCTION_EXISTS(sbrk HAVE_SBRK)
CHECK_FUNCTION_EXISTS(getdelim HAVE_GETDELIM)
CHECK_FUNCTION_EXISTS(getline HAVE_GETLINE)
Expand Down Expand Up @@ -518,6 +527,14 @@ if (GETTEXT_FOUND)
set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE)
endif(GETTEXT_FOUND)

if (USE_UIKIT)
set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "IOS found" TRUE)
set(XGETTEXT "/usr/local/bin/xgettext")
set(GETTEXT_MSGMERGE_EXECUTABLE "/usr/local/bin/msgmerge")
set(GETTEXT_MSGFMT_EXECUTABLE "/usr/local/bin/msgfmt")
add_compile_definitions(IOS)
endif(USE_UIKIT)

#Independent modules
add_module(graphics/null "Default" TRUE)
add_module(osd/core "Default" TRUE)
Expand Down Expand Up @@ -602,7 +619,11 @@ add_feature(BUILD_MAPTOOL "default" TRUE)
add_feature(XSL_PROCESSING "default" TRUE)

set(SUPPORTED_XSLT_PROCESSORS "saxonb-xslt;saxon;saxon8;saxon-xslt;xsltproc;transform.exe")
find_program(XSLT_PROCESSOR NAMES ${SUPPORTED_XSLT_PROCESSORS})
if (USE_UIKIT)
find_host_program(XSLT_PROCESSOR NAMES ${SUPPORTED_XSLT_PROCESSORS})
else (USE_UIKIT)
find_program(XSLT_PROCESSOR NAMES ${SUPPORTED_XSLT_PROCESSORS})
endif (USE_UIKIT)
if(XSLT_PROCESSOR)
message(STATUS "Found XSLT processor: ${XSLT_PROCESSOR}")
execute_process(COMMAND ${XSLT_PROCESSOR} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt
Expand Down Expand Up @@ -716,11 +737,11 @@ endif()
if (APPLE OR USE_UIKIT)
set_with_reason(vehicle/iphone "apple detected" TRUE)
set_with_reason(graphics/cocoa "apple detected" TRUE)
if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/VoiceServices.framework")
if (USE_UIKIT)
set_with_reason(speech/iphone "apple detected" TRUE)
endif()
endif(USE_UIKIT)
set(BUILD_BUNDLE TRUE CACHE BOOLEAN "build an osx bundle")
endif()
endif(APPLE OR USE_UIKIT)

if(CMAKE_SIZEOF_VOID_P LESS 8)
set_with_reason(BUILD_MAPTOOL "maptool works only on 64 bit architectures" FALSE)
Expand Down Expand Up @@ -790,7 +811,11 @@ if(FREETYPE_FOUND AND NOT FONTCONFIG_FOUND)
endif()

# Image conversion
find_program(IMAGE_CONVERTER NAMES convert)
if (USE_UIKIT)
find_host_program(IMAGE_CONVERTER NAMES rsvg-convert)
else (USE_UIKIT)
find_program(IMAGE_CONVERTER NAMES convert)
endif (USE_UIKIT)
execute_process(COMMAND ${IMAGE_CONVERTER} -list format OUTPUT_VARIABLE CONVERT_FORMATS)
if(CONVERT_FORMATS MATCHES ".*XPM[ *][ ]*XPM[ ]*r[w-].*")
set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER})
Expand All @@ -801,7 +826,11 @@ if (SVG2PNG)
if (NOT IMAGE_CONVERTER_SVGZ)
set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4 inkscape)
set (CMAKE_FIND_APPBUNDLE "NEVER")
find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin)
if (USE_UIKIT)
find_host_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS})
else (USE_UIKIT)
find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin)
endif (USE_UIKIT)
if (NOT IMAGE_CONVERTER_SVGZ)
if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*")
set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER})
Expand Down Expand Up @@ -842,6 +871,9 @@ message(STATUS "Use plugins: ${MODULE_BUILD_TYPE}")
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
if(USE_UIKIT)
set(HAVE_UNISTD_H TRUE)
endif(USE_UIKIT)
Copy link
Member

Choose a reason for hiding this comment

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

Should be detected automatically as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN)
CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC)
Expand Down Expand Up @@ -937,3 +969,10 @@ add_subdirectory (man)
if (USE_NATIVE_LANGUAGE_SUPPORT)
add_subdirectory (po)
endif(USE_NATIVE_LANGUAGE_SUPPORT)

if (APPLE)
SET_XCODE_PROPERTY(navit CODE_SIGN_IDENTITY ${CODE_SIGN_IDENTITY})
message(STATUS "CODE_SIGN_IDENTITY: ${CODE_SIGN_IDENTITY}")
SET_XCODE_PROPERTY(navit DEVELOPMENT_TEAM ${DEVELOPMENT_TEAM_ID})
message(STATUS "DEVELOPMENT_TEAM_ID: ${DEVELOPMENT_TEAM_ID}")
endif (APPLE)
225 changes: 225 additions & 0 deletions Toolchain/xcode-iphone_new.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# Taken from https://github.com/tdlib/td/blob/master/CMake/iOS.cmake
# This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake
# files which are included with CMake 2.8.4
# It has been altered for iOS development

# Options:
#
# IOS_PLATFORM = OS (default) or SIMULATOR
# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders
# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch.
# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
#
# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
# If set manually, it will override the default location and force the user of a particular Developer Platform
#
# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder
# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
# If set manually, this will force the use of a specific SDK version
#
# IOS_BITCODE = 1/0: Enable bitcode or not. Only iOS >= 6.0 device build can enable bitcode. Default is enabled.

# Macros:
#
# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE)
# A convenience macro for setting xcode specific properties on targets
# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1")
#
# find_host_package (PROGRAM ARGS)
# A macro used to find executable programs on the host system, not within the iOS environment.
# Thanks to the android-cmake project for providing the command

# Standard settings
set (CMAKE_SYSTEM_NAME Darwin)
set (CMAKE_SYSTEM_VERSION 1)
set (CMAKE_CROSSCOMPILING TRUE)
set (UNIX TRUE)
set (APPLE TRUE)
set (IOS TRUE)

if(NOT DEFINED IOS_BITCODE) # check xcode/clang version? since xcode 7
set(IOS_BITCODE 1)
endif()
set(IOS_BITCODE_MARKER 0)

# Required as of cmake 2.8.10
set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)

# Determine the cmake host system version so we know where to find the iOS SDKs
find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
if (CMAKE_UNAME)
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
endif (CMAKE_UNAME)

set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)

# Skip the platform compiler checks for cross compiling
set (CMAKE_CXX_COMPILER_WORKS TRUE)
set (CMAKE_C_COMPILER_WORKS TRUE)

# All iOS/Darwin specific settings - some may be redundant
set (CMAKE_SHARED_LIBRARY_PREFIX "lib")
set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
set (CMAKE_SHARED_MODULE_PREFIX "lib")
set (CMAKE_SHARED_MODULE_SUFFIX ".so")
set (CMAKE_MODULE_EXISTS 1)
set (CMAKE_DL_LIBS "")

if(IOS_BITCODE)
set(BITCODE_FLAGS "-fembed-bitcode")
elseif(IOS_BITCODE_MARKER)
set(BITCODE_FLAGS "-fembed-bitcode-marker")
endif()

set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

# Hidden visibilty is required for cxx on iOS
set (CMAKE_C_FLAGS_INIT "${BITCODE_FLAGS}")
set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden ${BITCODE_FLAGS}")

set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")

set (CMAKE_PLATFORM_HAS_INSTALLNAME 1)
set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")

# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
endif ()

# Setup iOS platform unless specified manually with IOS_PLATFORM
if (NOT DEFINED IOS_PLATFORM)
set (IOS_PLATFORM "OS")
endif ()
set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")

# Setup building for arm64 or not
if (NOT DEFINED BUILD_ARM64)
set (BUILD_ARM64 true)
endif ()
set (BUILD_ARM64 ${BUILD_ARM64} CACHE STRING "Build arm64 arch or not")

# Check the platform selection and setup for developer root
if (${IOS_PLATFORM} STREQUAL "OS")
set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")

# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
set (IS_SIMULATOR true)
set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")

# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
else ()
message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR")
endif ()

# Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
# Note Xcode 4.3 changed the installation location, choose the most recent one available
exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
set (XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
if (EXISTS ${XCODE_POST_43_ROOT})
set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT})
elseif(EXISTS ${XCODE_PRE_43_ROOT})
set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT})
endif (EXISTS ${XCODE_POST_43_ROOT})
endif ()
set (CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform")

# Find and use the most recent iOS sdk unless specified manually with CMAKE_IOS_SDK_ROOT
if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
if (_CMAKE_IOS_SDKS)
list (SORT _CMAKE_IOS_SDKS)
list (REVERSE _CMAKE_IOS_SDKS)
list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
else (_CMAKE_IOS_SDKS)
message (FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
endif (_CMAKE_IOS_SDKS)
message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
endif ()
set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")

# Set the sysroot default to the most recent SDK
set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")

# set the architecture for iOS
if (${IOS_PLATFORM} STREQUAL "OS")
set (IOS_ARCH arm64)
elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
set (IOS_ARCH i386;x86_64)
endif ()

set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS")

# Set the find root to the iOS developer roots and to user defined paths
set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS find search path root")

# default to searching for frameworks first
set (CMAKE_FIND_FRAMEWORK FIRST)

# set up the default search directories for frameworks
set (CMAKE_SYSTEM_FRAMEWORK_PATH
${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
)

# only search the iOS sdks, not the remainder of the host filesystem
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


# This little macro lets you set any XCode specific property
macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
endmacro (set_xcode_property)


# This macro lets you find executable programs on the host system
macro (find_host_package)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set (IOS FALSE)

find_package(${ARGN})

set (IOS TRUE)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endmacro (find_host_package)

macro (find_host_program)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set (IOS FALSE)

find_program(${ARGN})

set (IOS TRUE)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endmacro (find_host_program)
4 changes: 3 additions & 1 deletion navit/Info.plist
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>navit needs access to your location to be of a kind of use</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
Expand Down
1 change: 1 addition & 0 deletions navit/attr_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ATTR(vehicle_height)
ATTR(vehicle_weight)
ATTR(vehicle_axle_weight)
ATTR(vehicle_dangerous_goods)
ATTR(vehicle_request_location_authorization)
ATTR(shmsize)
ATTR(shmoffset)
ATTR_UNUSED
Expand Down
4 changes: 4 additions & 0 deletions navit/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ static void sigsegv(int sig) {
sprintf(buffer, "gdb -ex bt %s %d", gdb_program, getpid());
else
sprintf(buffer, "gdb -ex bt -ex detach -ex quit %s %d", gdb_program, getpid());
#if IOS
jkoan marked this conversation as resolved.
Show resolved Hide resolved
return 1; //system not available in iOS
jkoan marked this conversation as resolved.
Show resolved Hide resolved
#else
retval = system(buffer);
#endif
fprintf(stderr, "calling gdb returned %d\n", retval);
exit(1);
}
Expand Down
4 changes: 3 additions & 1 deletion navit/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ void graphics_free(struct graphics *gra) {
g_free(gra->default_font);
graphics_font_destroy_all(gra);
g_free(gra->font);
gra->meth.graphics_destroy(gra->priv);
if (gra->meth.graphics_destroy) {
jkoan marked this conversation as resolved.
Show resolved Hide resolved
gra->meth.graphics_destroy(gra->priv);
}
g_free(gra);
}

Expand Down
1 change: 1 addition & 0 deletions navit/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct graphics_methods {
navit_float (*get_dpi)(struct graphics_priv * gr);
void (*draw_polygon_with_holes) (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count,
int hole_count, int* ccount, struct point **holes);
int(*get_has_appeared) (void); // To check view has appeared on iOS
jkoan marked this conversation as resolved.
Show resolved Hide resolved
};


Expand Down
Loading