Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AnForA Android Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DSDF
AnForA
AnForA Android Toolbox
Commits
de90ea04
Commit
de90ea04
authored
2 years ago
by
Alderico Gallo
Browse files
Options
Downloads
Patches
Plain Diff
Added find and findrec subcommands
parent
95cad423
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#304
passed
2 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
android-toolchain.cmake
+1
-0
1 addition, 0 deletions
android-toolchain.cmake
build-local.sh
+1
-1
1 addition, 1 deletion
build-local.sh
src/main.cpp
+29
-0
29 additions, 0 deletions
src/main.cpp
with
32 additions
and
2 deletions
CMakeLists.txt
+
1
−
1
View file @
de90ea04
...
...
@@ -4,7 +4,7 @@ include(android-toolchain.cmake)
project
(
AnForAAndroidToolbox
)
set
(
CMAKE_CXX_STANDARD
17
)
set
(
CMAKE_CXX_STANDARD
20
)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -ffunction-sections -fdata-sections")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -ffunction-sections -fdata-sections")
#set(CMAKE_LDFLAGS "${CMAKE_LDFLAGS} -Wl,--gc-sections")
...
...
This diff is collapsed.
Click to expand it.
android-toolchain.cmake
+
1
−
0
View file @
de90ea04
# https://stackoverflow.com/a/67729248
set
(
CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY
)
set
(
CMAKE_CXX_STANDARD 20
)
if
(
DEFINED ENV{NDK_HOME}
)
set
(
CMAKE_TOOLCHAIN_DIRECTORY
"$ENV{NDK_HOME}/build/cmake"
)
...
...
This diff is collapsed.
Click to expand it.
build-local.sh
+
1
−
1
View file @
de90ea04
#!/bin/sh
export
NDK_VERSION
=
"2
4.0.8215888
"
#"21.4.7075529"
export
NDK_VERSION
=
"2
5.1.8937393
"
#"21.4.7075529"
export
ANDROID_HOME
=
"
${
HOME
}
/Android/Sdk"
./build.sh
This diff is collapsed.
Click to expand it.
src/main.cpp
+
29
−
0
View file @
de90ea04
...
...
@@ -2,6 +2,7 @@
#include
<sys/time.h>
#include
<cstring>
#include
<vector>
#include
<filesystem>
std
::
vector
<
std
::
string
>
*
string_split
(
const
std
::
string
&
s
,
const
std
::
string
&
del
=
" "
)
{
...
...
@@ -74,6 +75,28 @@ int subcommand_time(int i, char *arguments[])
return
-
1
;
}
int
print_dir_recursive
(
char
*
arguments
[],
bool
recursive
)
{
auto
path
=
std
::
string
(
arguments
[
0
]);
//TODO remove code duplication
if
(
recursive
)
{
for
(
std
::
filesystem
::
recursive_directory_iterator
i
(
path
),
end
;
i
!=
end
;
++
i
)
if
(
is_directory
(
i
->
path
()))
std
::
cout
<<
i
->
path
().
generic_string
()
<<
"/
\n
"
;
else
std
::
cout
<<
i
->
path
().
generic_string
()
<<
"
\n
"
;
}
else
{
for
(
std
::
filesystem
::
directory_iterator
i
(
path
),
end
;
i
!=
end
;
++
i
)
if
(
is_directory
(
i
->
path
()))
std
::
cout
<<
i
->
path
().
generic_string
()
<<
"/
\n
"
;
else
std
::
cout
<<
i
->
path
().
generic_string
()
<<
"
\n
"
;
}
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>
1
)
...
...
@@ -82,6 +105,12 @@ int main(int argc, char *argv[])
if
(
subtool
==
"time"
)
{
return
subcommand_time
(
argc
-
2
,
&
argv
[
2
]);
}
else
if
(
subtool
==
"find"
)
{
return
print_dir_recursive
(
&
argv
[
2
],
false
);
}
else
if
(
subtool
==
"findrec"
)
{
return
print_dir_recursive
(
&
argv
[
2
],
true
);
}
else
{
std
::
cout
<<
"Unknown command"
<<
std
::
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment