This repository was archived by the owner on Oct 25, 2024. It is now read-only.
File tree 3 files changed +22
-3
lines changed
intel_extension_for_transformers/llm/runtime/graph
3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ if (NE_GELU_VEC)
91
91
endif ()
92
92
option (NE_PYTHON_API "neural_engine: use python api" OFF )
93
93
option (NE_SIMD_VEC_DOT_F16 "neural_engine: enable vec_dot_fp16 SIMD optimization" ON )
94
+
95
+ option (BUILD_SHARED_LIBS "If build as shared libs" ON )
96
+
94
97
if (NE_SIMD_VEC_DOT_F16)
95
98
add_compile_definitions (NE_SIMD_VEC_DOT_F16)
96
99
endif ()
Original file line number Diff line number Diff line change @@ -36,9 +36,25 @@ function(add_executable_w_warning TARGET)
36
36
warning_check(${TARGET} )
37
37
endfunction ()
38
38
39
- function (add_library_w_warning TARGET )
40
- add_library (${TARGET} STATIC ${ARGN} )
39
+ function (add_library_w_warning_ TARGET )
40
+ add_library (${TARGET} ${ARGN} )
41
41
set_target_properties (${TARGET} PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF )
42
42
set_target_properties (${TARGET} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF )
43
43
warning_check(${TARGET} )
44
44
endfunction ()
45
+
46
+ function (add_library_w_warning TARGET )
47
+ add_library_w_warning_(${TARGET} STATIC ${ARGN} )
48
+ endfunction ()
49
+
50
+ function (add_shared_library_w_warning TARGET )
51
+ add_library_w_warning_(${TARGET} SHARED ${ARGN} )
52
+ endfunction ()
53
+
54
+ function (add_shareable_library_w_warning TARGET )
55
+ if (BUILD_SHARED_LIBS )
56
+ add_library_w_warning_(${TARGET} SHARED ${ARGN} )
57
+ else ()
58
+ add_library_w_warning_(${TARGET} STATIC ${ARGN} )
59
+ endif ()
60
+ endfunction ()
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ find_package(Threads REQUIRED)
16
16
file (GLOB layers_srcs "layers/*.cpp" )
17
17
set (sources ne_layers.c ${layers_srcs} )
18
18
19
- add_library_w_warning (ne_layers "${sources} " )
19
+ add_shareable_library_w_warning (ne_layers "${sources} " )
20
20
21
21
target_include_directories (ne_layers PUBLIC .)
22
22
target_compile_features (ne_layers PUBLIC c_std_11) # don't bump
You can’t perform that action at this time.
0 commit comments