-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
102 lines (91 loc) · 2.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
cmake_minimum_required(VERSION 3.16)
project(FaustLLVMTester LANGUAGES CXX)
include(FetchContent)
include(CTest)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_PREFIX_PATH "${OSSIA_SDK}/faust")
set(THREADS_PREFER_PTHREAD_FLAG 1)
find_package(Faust REQUIRED)
find_package(Threads)
FetchContent_Declare(
faustlibs
GIT_REPOSITORY https://github.com/grame-cncm/faustlibraries
GIT_TAG cf12b8bda9bb5513303a11746e50629a78524cd3
GIT_SHALLOW 1
)
FetchContent_Declare(
testdsps
GIT_REPOSITORY https://github.com/ossia/score-user-library
GIT_TAG master
GIT_SHALLOW 1
)
if(NOT faustlibs_POPULATED)
# Fetch the content using previously declared details
FetchContent_Populate(faustlibs)
FetchContent_Populate(testdsps)
endif()
set(FAUST_LIBS_ROOT "${faustlibs_SOURCE_DIR}")
set(FAUST_DSP_ROOT "${testdsps_SOURCE_DIR}/Presets/Faust")
set(CMAKE_CXX_STANDARD 20)
if(WIN32)
if(MSVC)
add_compile_options(-EHa)
else()
add_compile_options(-fms-extensions)
endif()
elseif(APPLE)
else()
# Link option required for exporting symbols on Linux. Unneeded on Mac & Win32
add_link_options(-Wl,--export-dynamic)
endif()
add_executable(FaustTesterSingle FaustTester.cpp tables/STK/tables.cpp tables/Guitarix/tables.cpp)
add_executable(FaustTesterDouble FaustTester.cpp tables/STK/tables.cpp tables/Guitarix/tables.cpp)
target_compile_definitions(FaustTesterSingle
PUBLIC
FAUSTFLOAT=float
"FAUST_LIBS_ROOT=${FAUST_LIBS_ROOT}"
)
target_compile_definitions(FaustTesterDouble
PUBLIC
FAUSTFLOAT=double
"FAUST_LIBS_ROOT=${FAUST_LIBS_ROOT}"
)
target_link_libraries(FaustTesterSingle
PUBLIC
Faust
Threads::Threads
)
target_link_libraries(FaustTesterDouble
PUBLIC
Faust
Threads::Threads
)
file(GLOB_RECURSE
FAUST_DSPS
LIST_DIRECTORIES false
CONFIGURE_DEPENDS
RELATIVE "${FAUST_DSP_ROOT}"
"${FAUST_DSP_ROOT}/*.dsp"
)
foreach(file ${FAUST_DSPS})
if(NOT "${file}" MATCHES ".*layout.*")
set(FILENAME "${FAUST_DSP_ROOT}/${file}")
set(TESTNAME "${file}")
string(REPLACE ".dsp" "" TESTNAME "${TESTNAME}")
string(MAKE_C_IDENTIFIER "${TESTNAME}" TESTNAME )
add_test(
NAME ${TESTNAME}_single
COMMAND FaustTesterSingle "${FILENAME}"
)
set_tests_properties(${TESTNAME}_single PROPERTIES
FAIL_REGULAR_EXPRESSION "[eE]rror;ERROR;[fF]ail;FAIL;SEGFAULT"
)
add_test(
NAME ${TESTNAME}_double
COMMAND FaustTesterDouble "${FILENAME}"
)
set_tests_properties(${TESTNAME}_double PROPERTIES
FAIL_REGULAR_EXPRESSION "[eE]rror;ERROR;[fF]ail;FAIL;SEGFAULT"
)
endif()
endforeach()