-
Notifications
You must be signed in to change notification settings - Fork 1k
/
CMakeLists.txt
37 lines (30 loc) · 1.15 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.10)
project(wav2letter++ CXX C)
# C++ 14 is required
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(flashlight CONFIG REQUIRED)
if (flashlight_VERSION VERSION_GREATER_EQUAL 0.4)
message(FATAL_ERROR "Cannot build wav2letter recipes with a Flashlight "
"version greater than v0.4. Use Flashlight's 0.3 branch to build.")
endif()
if (FL_USE_CUDA)
enable_language(CUDA)
endif()
if (NOT TARGET flashlight::fl_pkg_speech)
message(FATAL_ERROR "flashlight must be build with app/asr for wav2letter++")
endif ()
include(CheckCXXCompilerFlag)
# All libraries should have their symbols exported so plugins can lazily
# symbols from any of them
check_cxx_compiler_flag("-rdynamic" COMPILER_SUPPORTS_RDYNAMIC)
if(${COMPILER_SUPPORTS_RDYNAMIC})
message(STATUS "-rdynamic supported.")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
else()
message(WARNING
"This compiler doesn't support dynamic symbol exports. "
"Plugin functionality likely won't work.")
endif()
add_subdirectory(${PROJECT_SOURCE_DIR}/recipes)