Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c0786e9d
Commit
c0786e9d
authored
Aug 27, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for the gold linker (NDK r8b is required)
parent
bcf8dd51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
android.toolchain.cmake
android/android.toolchain.cmake
+16
-3
No files found.
android/android.toolchain.cmake
View file @
c0786e9d
...
...
@@ -187,7 +187,8 @@
# [+] updated for NDK r8b
# [~] all intermediate files generated by toolchain are moved into CMakeFiles
# [~] libstdc++ and libsupc are removed from explicit link libraries
# [+] added ccache support (via NDK_CCACHE environment or cmake variable)
# [+] added CCache support (via NDK_CCACHE environment or cmake variable)
# [+] added gold linker support for NDK r8b
# ------------------------------------------------------------------------------
cmake_minimum_required
(
VERSION 2.6.3
)
...
...
@@ -941,7 +942,7 @@ if( ANDROID_SO_UNDEFINED )
endif
()
__INIT_VARIABLE
(
ANDROID_FUNCTION_LEVEL_LINKING VALUES ON
)
set
(
ANDROID_FUNCTION_LEVEL_LINKING
ON
CACHE BOOL
"Allows or disallows undefined symbols in shared libraries"
FORCE
)
set
(
ANDROID_FUNCTION_LEVEL_LINKING
${
ANDROID_FUNCTION_LEVEL_LINKING
}
CACHE BOOL
"Allows or disallows undefined symbols in shared libraries"
FORCE
)
mark_as_advanced
(
ANDROID_FUNCTION_LEVEL_LINKING
)
if
(
ANDROID_FUNCTION_LEVEL_LINKING
)
set
(
ANDROID_CXX_FLAGS
"
${
ANDROID_CXX_FLAGS
}
-fdata-sections -ffunction-sections"
)
...
...
@@ -954,6 +955,15 @@ if( ARMEABI_V7A )
set
(
ANDROID_LINKER_FLAGS
"-Wl,--fix-cortex-a8
${
ANDROID_LINKER_FLAGS
}
"
)
endif
()
if
(
CMAKE_HOST_UNIX AND ANDROID_COMPILER_VERSION VERSION_EQUAL
"4.6"
AND
(
ARMEABI_V7A OR X86
)
)
__INIT_VARIABLE
(
ANDROID_USE_GOLD_LINKER VALUES ON
)
set
(
ANDROID_USE_GOLD_LINKER
${
ANDROID_USE_GOLD_LINKER
}
CACHE BOOL
"Enables gold linker"
FORCE
)
mark_as_advanced
(
ANDROID_USE_GOLD_LINKER
)
if
(
ANDROID_USE_GOLD_LINKER
)
set
(
ANDROID_LINKER_FLAGS
"
${
ANDROID_LINKER_FLAGS
}
-fuse-ld=gold"
)
endif
()
endif
()
# cache flags
set
(
CMAKE_CXX_FLAGS
"
${
_CMAKE_CXX_FLAGS
}
"
CACHE STRING
"c++ flags"
)
set
(
CMAKE_C_FLAGS
"
${
_CMAKE_C_FLAGS
}
"
CACHE STRING
"c flags"
)
...
...
@@ -1058,7 +1068,8 @@ if( NOT PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
set
(
__toolchain_config
""
)
foreach
(
__var NDK_CCACHE ANDROID_ABI ANDROID_FORCE_ARM_BUILD ANDROID_NATIVE_API_LEVEL ANDROID_NO_UNDEFINED
ANDROID_SO_UNDEFINED ANDROID_SET_OBSOLETE_VARIABLES LIBRARY_OUTPUT_PATH_ROOT ANDROID_USE_STLPORT
ANDROID_FORBID_SYGWIN ANDROID_NDK ANDROID_STANDALONE_TOOLCHAIN ANDROID_FUNCTION_LEVEL_LINKING __ndklibspath
)
ANDROID_FORBID_SYGWIN ANDROID_NDK ANDROID_STANDALONE_TOOLCHAIN ANDROID_FUNCTION_LEVEL_LINKING
ANDROID_USE_GOLD_LINKER __ndklibspath
)
if
(
DEFINED
${
__var
}
)
if
(
"
${
__var
}
"
MATCHES
" "
)
set
(
__toolchain_config
"
${
__toolchain_config
}
set(
${
__var
}
\"
${${
__var
}}
\"
CACHE INTERNAL
\"\"
)
\n
"
)
...
...
@@ -1092,9 +1103,11 @@ endif()
# ANDROID_NO_UNDEFINED : ON/OFF
# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version)
# ANDROID_FUNCTION_LEVEL_LINKING : ON/OFF
# ANDROID_USE_GOLD_LINKER : ON/OFF (default depends on NDK version and host & target platforms)
# Variables that takes effect only at first run:
# ANDROID_FORCE_ARM_BUILD : ON/OFF
# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
# NDK_CCACHE : <path to your ccache executable>
# Can be set only at the first run:
# ANDROID_NDK
# ANDROID_STANDALONE_TOOLCHAIN
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment