 +list(APPEND obj_srcs ${x86_srcs})
 +####################
 +set(incDirs $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> ${codec_SOURCE_DIR}/api/svc)
++if(CMAKE_ASM_NASM_COMPILER_LOADED)
++  list(APPEND incDirs $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/x86>)
++endif()
 +##########
 +add_library(${obj_name} OBJECT ${obj_srcs})
 +target_include_directories(${obj_name} PRIVATE ${incDirs})

+add_subdirectory(codec)
diff --git a/codec/CMakeLists.txt b/codec/CMakeLists.txt
new file mode 100644
index 0000000..cbaa05d
--- /dev/null
+++ b/codec/CMakeLists.txt
@@ -0,0 +1,44 @@
+project(codec)
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86")
+  enable_language(ASM_NASM)
+  if(CMAKE_ASM_NASM_COMPILER_LOADED)
+    # TRICKY: NASM needs trailing slash https://gitlab.kitware.com/cmake/cmake/issues/12919
+    set(asmInc -I${CMAKE_CURRENT_SOURCE_DIR}/common/x86/)
+    # TRICKY: CMAKE_ASM_NASM_COMPILE_OBJECT is defined in CMakeASM_NASMInformation.cmake as
+    # <CMAKE_ASM_NASM_COMPILER> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>
+    string(REPLACE "<INCLUDES> <FLAGS>" "${asmInc} -DUNIX64"
+      CMAKE_ASM_NASM_COMPILE_OBJECT ${CMAKE_ASM_NASM_COMPILE_OBJECT}
+      )
+    add_definitions(-DX86_ASM)
+  endif()
+endif()
+add_subdirectory(common)
+add_subdirectory(decoder)

+install(EXPORT ${targetsFile} DESTINATION lib/cmake)
diff --git a/codec/common/CMakeLists.txt b/codec/common/CMakeLists.txt
new file mode 100644
index 0000000..4df5e77
--- /dev/null
+++ b/codec/common/CMakeLists.txt
@@ -0,0 +1,103 @@
+set(lib_name common)
+set(obj_name ${lib_name}_obj)
+####################
