diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d2e1666a0114855851e75d66de6394b5cae41eb..7105e0d082b4d7bc35963ec04f944ec889e72ccb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,10 @@ set(OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR "install CMake package config modu
 option(OPUS_INSTALL_CMAKE_CONFIG_MODULE ${OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR} ON)
 add_feature_info(OPUS_INSTALL_CMAKE_CONFIG_MODULE OPUS_INSTALL_CMAKE_CONFIG_MODULE ${OPUS_INSTALL_CMAKE_CONFIG_MODULE_HELP_STR})
 
+set(OPUS_NEURAL_FEC_HELP_STR "enable neural FEC.")
+option(OPUS_NEURAL_FEC ${OPUS_NEURAL_FEC_HELP_STR} OFF)
+add_feature_info(OPUS_NEURAL_FEC OPUS_NEURAL_FEC ${OPUS_NEURAL_FEC_HELP_STR})
+
 if(APPLE)
   set(OPUS_BUILD_FRAMEWORK_HELP_STR "build Framework bundle for Apple systems.")
   option(OPUS_BUILD_FRAMEWORK ${OPUS_BUILD_FRAMEWORK_HELP_STR} OFF)
@@ -367,6 +371,13 @@ if(NOT OPUS_ENABLE_FLOAT_API)
   target_compile_definitions(opus PRIVATE DISABLE_FLOAT_API)
 endif()
 
+if (OPUS_NEURAL_FEC)
+  target_compile_definitions(opus PRIVATE ENABLE_NEURAL_FEC)
+  if(NOT OPUS_NEURAL_PLC)
+    target_compile_definitions(opus PRIVATE NEURAL_PLC)
+  endif()
+endif()
+
 if(NOT OPUS_DISABLE_INTRINSICS)
   if(((OPUS_X86_MAY_HAVE_SSE AND NOT OPUS_X86_PRESUME_SSE) OR
      (OPUS_X86_MAY_HAVE_SSE2 AND NOT OPUS_X86_PRESUME_SSE2) OR
@@ -655,4 +666,15 @@ if(BUILD_TESTING AND NOT BUILD_SHARED_LIBS)
         -DTEST_EXECUTABLE=$<TARGET_FILE:test_opus_extensions>
         -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
         -P "${PROJECT_SOURCE_DIR}/cmake/RunTest.cmake")
+  if(OPUS_NEURAL_FEC)
+    add_executable(test_opus_dred ${test_opus_dred_sources})
+    target_include_directories(test_opus_dred
+                              PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+    target_link_libraries(test_opus_dred PRIVATE opus)
+    target_compile_definitions(test_opus_dred PRIVATE OPUS_BUILD)
+    add_test(NAME test_opus_dred COMMAND ${CMAKE_COMMAND}
+          -DTEST_EXECUTABLE=$<TARGET_FILE:test_opus_dred>
+          -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+          -P "${PROJECT_SOURCE_DIR}/cmake/RunTest.cmake")
+  endif()
 endif()
diff --git a/cmake/OpusSources.cmake b/cmake/OpusSources.cmake
index cf8b87488e52a7f5e4c17d8acb49597b66ebfbf2..cb852c0a0e42e68511594c9a1fa3629e82cde7c3 100644
--- a/cmake/OpusSources.cmake
+++ b/cmake/OpusSources.cmake
@@ -52,3 +52,5 @@ get_opus_sources(tests_test_opus_decode_SOURCES Makefile.am
                  test_opus_decode_sources)
 get_opus_sources(tests_test_opus_padding_SOURCES Makefile.am
                  test_opus_padding_sources)
+get_opus_sources(tests_test_opus_dred_SOURCES Makefile.am
+                 test_opus_dred_sources)