add_subdirectory(src/backend)
file(GLOB SOURCES "src/*.cc")
-file(GLOB_RECURSE SOURCES_FRONTEND "src/frontend/*.cc")
file(GLOB SOURCES_BACKEND "src/backend/*.cc")
file(GLOB_RECURSE SOURCES_GRAPH "src/graph/*.cc")
file(GLOB_RECURSE SOURCES_LINEAR "src/linear/*.cc")
file(GLOB_RECURSE SOURCES_UTIL "src/util/*.cc")
file(GLOB_RECURSE SOURCES_MODEL "src/model/*.cc")
-set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_BACKEND} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_EXEC} ${SOURCES_VERIFIER} ${SOURCES_UTIL} ${SOURCES_MODEL})
+set(SOURCES ${SOURCES} ${SOURCES_BACKEND} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_DUMPER} ${SOURCES_COMPILER} ${SOURCES_EXEC} ${SOURCES_VERIFIER} ${SOURCES_UTIL} ${SOURCES_MODEL})
-add_library(${LIB_NEURUN} SHARED ${SOURCES})
+add_library(neurun-core STATIC ${SOURCES})
+set_target_properties(neurun-core PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(neurun-core PUBLIC ${NEURUN_INCLUDE_DIR})
+target_include_directories(neurun-core PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow)
+target_link_libraries(neurun-core nnapi-header)
+target_link_libraries(neurun-core tensorflow-lite)
+target_link_libraries(neurun-core nnfw_lib_misc)
+target_link_libraries(neurun-core nnfw_lib_cpp14)
+target_compile_options(neurun-core PRIVATE -Wall -Wextra -Werror)
+
+file(GLOB_RECURSE SOURCES_FRONTEND "frontend/nnapi/*.cc")
+
+add_library(${LIB_NEURUN} SHARED ${SOURCES_FRONTEND})
+target_include_directories(${LIB_NEURUN} PRIVATE frontend/nnapi)
target_include_directories(${LIB_NEURUN} PUBLIC ${NEURUN_INCLUDE_DIR})
target_include_directories(${LIB_NEURUN} PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow)
-target_link_libraries(${LIB_NEURUN} nnapi-header)
-target_link_libraries(${LIB_NEURUN} tensorflow-lite)
-target_link_libraries(${LIB_NEURUN} nnfw_lib_misc)
-target_link_libraries(${LIB_NEURUN} nnfw_lib_cpp14)
+target_link_libraries(${LIB_NEURUN} neurun-core)
target_compile_options(${LIB_NEURUN} PRIVATE -Wall -Wextra -Werror)
file(GLOB_RECURSE TESTS "test/*.cc")
add_executable(${TEST_NEURUN} ${TESTS})
+# NOTE This line is a workaround to resolve compilation error
+target_include_directories(${TEST_NEURUN} PRIVATE frontend/nnapi)
target_link_libraries(${TEST_NEURUN} ${LIB_NEURUN})
target_link_libraries(${TEST_NEURUN} gtest)
target_link_libraries(${TEST_NEURUN} gtest_main)