This repository was archived by the owner on Oct 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
intel_extension_for_transformers/llm/runtime/graph Expand file tree Collapse file tree 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)
9191endif ()
9292option (NE_PYTHON_API "neural_engine: use python api" OFF )
9393option (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+
9497if (NE_SIMD_VEC_DOT_F16)
9598 add_compile_definitions (NE_SIMD_VEC_DOT_F16)
9699endif ()
Original file line number Diff line number Diff line change @@ -36,9 +36,25 @@ function(add_executable_w_warning TARGET)
3636 warning_check(${TARGET} )
3737endfunction ()
3838
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} )
4141 set_target_properties (${TARGET} PROPERTIES C_STANDARD 11 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF )
4242 set_target_properties (${TARGET} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF )
4343 warning_check(${TARGET} )
4444endfunction ()
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)
1616file (GLOB layers_srcs "layers/*.cpp" )
1717set (sources ne_layers.c ${layers_srcs} )
1818
19- add_library_w_warning (ne_layers "${sources} " )
19+ add_shareable_library_w_warning (ne_layers "${sources} " )
2020
2121target_include_directories (ne_layers PUBLIC .)
2222target_compile_features (ne_layers PUBLIC c_std_11) # don't bump
You can’t perform that action at this time.
0 commit comments