File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
# For more information about using CMake with Android Studio, read the
2
2
# documentation: https://d.android.com/studio/projects/add-native-code.html.
3
3
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
4
-
5
4
# Sets the minimum CMake version required for this project.
6
5
cmake_minimum_required (VERSION 3.22.1 )
7
6
@@ -24,6 +23,12 @@ project("inference")
24
23
# System.loadLibrary() and pass the name of the library defined here;
25
24
# for GameActivity/NativeActivity derived applications, the same library name must be
26
25
# used in the AndroidManifest.xml file.
26
+
27
+ set (OPTIMIZATION_FLAGS
28
+ -Ofast
29
+ -fopenmp
30
+ )
31
+
27
32
add_library (${CMAKE_PROJECT_NAME} SHARED
28
33
# List C/C++ source files with relative paths to this CMakeLists.txt.
29
34
inference.c
@@ -35,4 +40,7 @@ add_library(${CMAKE_PROJECT_NAME} SHARED
35
40
target_link_libraries (${CMAKE_PROJECT_NAME}
36
41
# List libraries link to the target library
37
42
android
38
- log )
43
+ log
44
+ -fopenmp -static-openmp )
45
+
46
+ target_compile_options (${PROJECT_NAME} PUBLIC $< $< COMPILE_LANGUAGE:C> :${OPTIMIZATION_FLAGS} > )
You can’t perform that action at this time.
0 commit comments