Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

937 lines
26KB

  1. cmake_minimum_required(VERSION 3.15)
  2. project(carla)
  3. set(CMAKE_POLICY_DEFAULT_CMP0025 NEW)
  4. set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
  5. set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
  6. set(CMAKE_C_STANDARD 11)
  7. set(CMAKE_CXX_STANDARD 11)
  8. set(CMAKE_C_VISIBILITY_PRESET hidden)
  9. set(CMAKE_CXX_VISIBILITY_PRESET hidden)
  10. set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
  11. set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
  12. #######################################################################################################################
  13. # fix compat with cmake < 3.26
  14. if(CMAKE_VERSION VERSION_LESS 3.26)
  15. if(MSVC)
  16. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
  17. else()
  18. set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
  19. endif()
  20. mark_as_advanced(CMAKE_C_COMPILER_FRONTEND_VARIANT)
  21. endif()
  22. #######################################################################################################################
  23. # build options
  24. if(MSVC)
  25. set(CARLA_USE_JACK_DEFAULT FALSE)
  26. set(CARLA_USE_OSC_DEFAULT FALSE)
  27. else()
  28. set(CARLA_USE_JACK_DEFAULT TRUE)
  29. set(CARLA_USE_OSC_DEFAULT TRUE)
  30. endif()
  31. set(CARLA_USE_JACK ${CARLA_USE_JACK_DEFAULT} CACHE BOOL "Enable JACK")
  32. set(CARLA_USE_OSC ${CARLA_USE_OSC_DEFAULT} CACHE BOOL "Enable OSC")
  33. #######################################################################################################################
  34. # required dependencies
  35. find_package(Threads REQUIRED)
  36. if(NOT (APPLE OR HAIKU OR WIN32))
  37. set(CARLA_LIBDL dl)
  38. set(CARLA_LIBM m)
  39. set(CARLA_LIBRT rt)
  40. endif()
  41. #######################################################################################################################
  42. # optional dependencies
  43. find_package(PkgConfig QUIET)
  44. # homebrew does not support universal binaries, disable external deps if it is in use
  45. if(APPLE)
  46. find_program(HOMEBREW brew)
  47. if(HOMEBREW)
  48. set(PKGCONFIG_FOUND FALSE)
  49. mark_as_advanced(PKGCONFIG_FOUND)
  50. endif()
  51. endif()
  52. if(PKGCONFIG_FOUND)
  53. pkg_check_modules(FLUIDSYNTH IMPORTED_TARGET fluidsynth)
  54. pkg_check_modules(SNDFILE IMPORTED_TARGET sndfile)
  55. else()
  56. set(FLUIDSYNTH_FOUND FALSE)
  57. set(LIBLO_FOUND FALSE)
  58. set(SNDFILE_FOUND FALSE)
  59. endif()
  60. if(PKGCONFIG_FOUND AND CARLA_USE_OSC)
  61. pkg_check_modules(LIBLO IMPORTED_TARGET liblo)
  62. else()
  63. set(LIBLO_FOUND FALSE)
  64. endif()
  65. if(PKGCONFIG_FOUND AND NOT WIN32)
  66. pkg_check_modules(LIBMAGIC IMPORTED_TARGET libmagic)
  67. else()
  68. set(LIBMAGIC_FOUND FALSE)
  69. endif()
  70. if(PKGCONFIG_FOUND AND NOT (APPLE OR WIN32))
  71. pkg_check_modules(X11 IMPORTED_TARGET x11)
  72. else()
  73. set(X11_FOUND FALSE)
  74. endif()
  75. add_library(carla-none INTERFACE)
  76. if(NOT FLUIDSYNTH_FOUND)
  77. add_library(PkgConfig::FLUIDSYNTH ALIAS carla-none)
  78. endif()
  79. if(NOT LIBLO_FOUND)
  80. add_library(PkgConfig::LIBLO ALIAS carla-none)
  81. endif()
  82. if(NOT LIBMAGIC_FOUND)
  83. add_library(PkgConfig::LIBMAGIC ALIAS carla-none)
  84. endif()
  85. if(NOT SNDFILE_FOUND)
  86. add_library(PkgConfig::SNDFILE ALIAS carla-none)
  87. endif()
  88. if(NOT X11_FOUND)
  89. add_library(PkgConfig::X11 ALIAS carla-none)
  90. endif()
  91. #######################################################################################################################
  92. # utilities
  93. function(set_common_target_properties TARGET)
  94. target_compile_definitions(${TARGET}
  95. PRIVATE
  96. BUILDING_CARLA
  97. HAVE_YSFX
  98. $<$<BOOL:${CARLA_USE_JACK}>:HAVE_JACK>
  99. $<$<BOOL:${FLUIDSYNTH_FOUND}>:HAVE_FLUIDSYNTH>
  100. $<$<BOOL:${LIBLO_FOUND}>:HAVE_LIBLO>
  101. $<$<BOOL:${LIBMAGIC_FOUND}>:HAVE_LIBMAGIC>
  102. $<$<BOOL:${SNDFILE_FOUND}>:HAVE_SNDFILE>
  103. $<$<BOOL:${X11_FOUND}>:HAVE_X11>
  104. )
  105. target_compile_options(${TARGET}
  106. PRIVATE
  107. $<$<BOOL:${MSVC}>:/wd4244>
  108. $<$<BOOL:${MSVC}>:/wd4267>
  109. $<$<BOOL:${MSVC}>:/wd4273>
  110. )
  111. target_link_options(${TARGET}
  112. PRIVATE
  113. $<$<C_COMPILER_ID:GNU>:-Wl,--no-undefined>
  114. )
  115. set_property(TARGET ${TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)
  116. if(APPLE)
  117. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES arm64)
  118. set_property(TARGET ${TARGET} APPEND PROPERTY OSX_ARCHITECTURES x86_64)
  119. endif()
  120. endfunction()
  121. #######################################################################################################################
  122. # setup pthreads for msvc
  123. if(MSVC)
  124. include(FetchContent)
  125. FetchContent_Declare(pthreads4w
  126. GIT_REPOSITORY https://git.code.sf.net/p/pthreads4w/code
  127. GIT_TAG f12b445b336ee0117b43fca1d4b9f22c9af82c36
  128. )
  129. FetchContent_MakeAvailable(pthreads4w)
  130. add_library(pthreads4w STATIC)
  131. add_library(carla::pthreads4w ALIAS pthreads4w)
  132. target_sources(pthreads4w PRIVATE ${pthreads4w_SOURCE_DIR}/pthread.c)
  133. target_compile_definitions(pthreads4w
  134. PRIVATE
  135. HAVE_CONFIG_H
  136. HAVE_STDINT_H=1
  137. _POSIX_C_SOURCE=200112L
  138. PUBLIC
  139. INCLUDE_NP
  140. PTW32_DLLPORT
  141. __PTW32_STATIC_LIB
  142. )
  143. target_include_directories(pthreads4w
  144. PUBLIC
  145. ${pthreads4w_SOURCE_DIR}
  146. )
  147. set(CARLA_PTHREADS carla::pthreads4w)
  148. else()
  149. set(CARLA_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
  150. endif()
  151. #######################################################################################################################
  152. # audio_decoder
  153. add_library(carla-audio-decoder STATIC)
  154. add_library(carla::audio-decoder ALIAS carla-audio-decoder)
  155. set_common_target_properties(carla-audio-decoder)
  156. target_include_directories(carla-audio-decoder
  157. PRIVATE
  158. ../source/includes
  159. ../source/modules
  160. ../source/utils
  161. )
  162. target_link_libraries(carla-audio-decoder
  163. PRIVATE
  164. PkgConfig::SNDFILE
  165. )
  166. target_sources(carla-audio-decoder
  167. PRIVATE
  168. ../source/modules/audio_decoder/ad_dr_mp3.c
  169. ../source/modules/audio_decoder/ad_ffmpeg.c
  170. ../source/modules/audio_decoder/ad_minimp3.c
  171. ../source/modules/audio_decoder/ad_plugin.c
  172. ../source/modules/audio_decoder/ad_soundfile.c
  173. )
  174. #######################################################################################################################
  175. # jackbridge
  176. add_library(carla-jackbridge STATIC)
  177. add_library(carla::jackbridge ALIAS carla-jackbridge)
  178. set_common_target_properties(carla-jackbridge)
  179. target_include_directories(carla-jackbridge
  180. PRIVATE
  181. ../source/includes
  182. ../source/utils
  183. )
  184. target_link_libraries(carla-jackbridge
  185. PRIVATE
  186. ${CARLA_LIBDL}
  187. ${CARLA_LIBRT}
  188. )
  189. target_sources(carla-jackbridge
  190. PRIVATE
  191. ../source/jackbridge/JackBridge1.cpp
  192. ../source/jackbridge/JackBridge2.cpp
  193. )
  194. #######################################################################################################################
  195. # lilv
  196. # serd
  197. add_library(carla-lilv_serd STATIC)
  198. set_common_target_properties(carla-lilv_serd)
  199. target_compile_options(carla-lilv_serd
  200. PRIVATE
  201. $<$<BOOL:${MSVC}>:/wd4005>
  202. $<$<BOOL:${MSVC}>:/wd4090>
  203. $<$<BOOL:${MSVC}>:/wd4133>
  204. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  205. $<$<C_COMPILER_ID:GNU>:-Wno-implicit-fallthrough>
  206. )
  207. target_include_directories(carla-lilv_serd
  208. PRIVATE
  209. ../source/includes
  210. ../source/modules/lilv/config
  211. ../source/modules/lilv/serd-0.24.0
  212. )
  213. target_sources(carla-lilv_serd
  214. PRIVATE
  215. ../source/modules/lilv/serd.c
  216. )
  217. # sord
  218. add_library(carla-lilv_sord STATIC)
  219. set_common_target_properties(carla-lilv_sord)
  220. target_compile_options(carla-lilv_sord
  221. PRIVATE
  222. $<$<BOOL:${MSVC}>:/wd4005>
  223. $<$<BOOL:${MSVC}>:/wd4090>
  224. $<$<BOOL:${MSVC}>:/wd4133>
  225. $<$<C_COMPILER_ID:GNU>:-Wno-maybe-uninitialized>
  226. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  227. # workaround compiler bug, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109585
  228. $<$<C_COMPILER_ID:GNU>:-fno-strict-aliasing>
  229. )
  230. target_include_directories(carla-lilv_sord
  231. PRIVATE
  232. ../source/includes
  233. ../source/modules/lilv/config
  234. ../source/modules/lilv/sord-0.16.0
  235. ../source/modules/lilv/sord-0.16.0/src
  236. )
  237. target_link_libraries(carla-lilv_sord
  238. PRIVATE
  239. carla-lilv_serd
  240. )
  241. target_sources(carla-lilv_sord
  242. PRIVATE
  243. ../source/modules/lilv/sord.c
  244. )
  245. # sratom
  246. add_library(carla-lilv_sratom STATIC)
  247. set_common_target_properties(carla-lilv_sratom)
  248. target_compile_options(carla-lilv_sratom
  249. PRIVATE
  250. $<$<BOOL:${MSVC}>:/wd4005>
  251. $<$<BOOL:${MSVC}>:/wd4090>
  252. $<$<BOOL:${MSVC}>:/wd4133>
  253. )
  254. target_include_directories(carla-lilv_sratom
  255. PRIVATE
  256. ../source/includes
  257. ../source/modules/lilv/config
  258. ../source/modules/lilv/sratom-0.6.0
  259. )
  260. target_link_libraries(carla-lilv_sratom
  261. PRIVATE
  262. carla-lilv_serd
  263. )
  264. target_sources(carla-lilv_sratom
  265. PRIVATE
  266. ../source/modules/lilv/sratom.c
  267. )
  268. # lilv
  269. add_library(carla-lilv_lilv STATIC)
  270. set_common_target_properties(carla-lilv_lilv)
  271. target_compile_options(carla-lilv_lilv
  272. PRIVATE
  273. $<$<BOOL:${MSVC}>:/wd4005>
  274. $<$<BOOL:${MSVC}>:/wd4090>
  275. $<$<BOOL:${MSVC}>:/wd4133>
  276. $<$<C_COMPILER_ID:AppleClang>:-Wno-incompatible-pointer-types-discards-qualifiers>
  277. $<$<C_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
  278. $<$<C_COMPILER_ID:GNU>:-Wno-discarded-qualifiers>
  279. $<$<C_COMPILER_ID:GNU>:-Wno-format-overflow>
  280. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  281. )
  282. target_include_directories(carla-lilv_lilv
  283. PRIVATE
  284. ../source/includes
  285. ../source/modules/lilv/config
  286. ../source/modules/lilv/lilv-0.24.0
  287. ../source/modules/lilv/lilv-0.24.0/src
  288. )
  289. target_link_libraries(carla-lilv_lilv
  290. PRIVATE
  291. carla-lilv_serd
  292. carla-lilv_sord
  293. carla-lilv_sratom
  294. )
  295. target_sources(carla-lilv_lilv
  296. PRIVATE
  297. ../source/modules/lilv/lilv.c
  298. )
  299. # combined target
  300. add_library(carla-lilv INTERFACE)
  301. add_library(carla::lilv ALIAS carla-lilv)
  302. target_link_libraries(carla-lilv
  303. INTERFACE
  304. carla-lilv_serd
  305. carla-lilv_sord
  306. carla-lilv_sratom
  307. carla-lilv_lilv
  308. ${CARLA_LIBDL}
  309. ${CARLA_LIBM}
  310. ${CARLA_LIBRT}
  311. )
  312. #######################################################################################################################
  313. # native-plugins
  314. add_library(carla-native-plugins STATIC)
  315. add_library(carla::native-plugins ALIAS carla-native-plugins)
  316. set_common_target_properties(carla-native-plugins)
  317. target_compile_definitions(carla-native-plugins
  318. PRIVATE
  319. $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
  320. )
  321. target_include_directories(carla-native-plugins
  322. PRIVATE
  323. ../source/includes
  324. ../source/modules
  325. ../source/utils
  326. )
  327. target_link_libraries(carla-native-plugins
  328. PRIVATE
  329. ${CARLA_PTHREADS}
  330. )
  331. target_sources(carla-native-plugins
  332. PRIVATE
  333. ../source/native-plugins/_all.c
  334. ../source/native-plugins/_data.cpp
  335. ../source/native-plugins/audio-gain.c
  336. ../source/native-plugins/bypass.c
  337. ../source/native-plugins/cv-to-audio.c
  338. ../source/native-plugins/lfo.c
  339. ../source/native-plugins/midi-channel-filter.c
  340. ../source/native-plugins/midi-channel-ab.c
  341. ../source/native-plugins/midi-channelize.c
  342. ../source/native-plugins/midi-gain.c
  343. ../source/native-plugins/midi-join.c
  344. ../source/native-plugins/midi-split.c
  345. ../source/native-plugins/midi-to-cv.c
  346. ../source/native-plugins/midi-through.c
  347. ../source/native-plugins/midi-transpose.c
  348. ../source/native-plugins/audio-file.cpp
  349. ../source/native-plugins/midi-file.cpp
  350. # these rely on PyQt, skip them
  351. # ../source/native-plugins/bigmeter.cpp
  352. # ../source/native-plugins/midi-pattern.cpp
  353. # ../source/native-plugins/notes.cpp
  354. # ../source/native-plugins/xycontroller.cpp
  355. )
  356. #######################################################################################################################
  357. # rtmempool
  358. add_library(carla-rtmempool STATIC)
  359. add_library(carla::rtmempool ALIAS carla-rtmempool)
  360. set_common_target_properties(carla-rtmempool)
  361. target_include_directories(carla-rtmempool
  362. PRIVATE
  363. ../source/includes
  364. ../source/utils
  365. )
  366. target_link_libraries(carla-rtmempool
  367. PRIVATE
  368. ${CARLA_LIBDL}
  369. ${CARLA_LIBRT}
  370. ${CARLA_PTHREADS}
  371. )
  372. target_sources(carla-rtmempool
  373. PRIVATE
  374. ../source/modules/rtmempool/rtmempool.c
  375. )
  376. #######################################################################################################################
  377. # sfzero
  378. add_library(carla-sfzero STATIC)
  379. add_library(carla::sfzero ALIAS carla-sfzero)
  380. set_common_target_properties(carla-sfzero)
  381. target_include_directories(carla-sfzero
  382. PRIVATE
  383. ../source/includes
  384. ../source/modules
  385. ../source/utils
  386. )
  387. target_link_libraries(carla-sfzero
  388. PRIVATE
  389. carla-audio-decoder
  390. ${CARLA_PTHREADS}
  391. )
  392. target_sources(carla-sfzero
  393. PRIVATE
  394. ../source/modules/sfzero/SFZero.cpp
  395. )
  396. #######################################################################################################################
  397. # water
  398. add_library(carla-water STATIC)
  399. add_library(carla::water ALIAS carla-water)
  400. set_common_target_properties(carla-water)
  401. target_compile_options(carla-water
  402. PRIVATE
  403. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  404. )
  405. target_include_directories(carla-water
  406. PRIVATE
  407. ../source/includes
  408. ../source/utils
  409. )
  410. target_link_libraries(carla-water
  411. PRIVATE
  412. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  413. $<$<BOOL:${WIN32}>:comdlg32>
  414. $<$<BOOL:${WIN32}>:ole32>
  415. $<$<BOOL:${WIN32}>:winmm>
  416. ${CARLA_LIBDL}
  417. ${CARLA_LIBRT}
  418. ${CARLA_PTHREADS}
  419. )
  420. target_sources(carla-water
  421. PRIVATE
  422. ../source/modules/water/water.cpp
  423. )
  424. #######################################################################################################################
  425. # water-files
  426. add_library(carla-water-files STATIC)
  427. add_library(carla::water-files ALIAS carla-water-files)
  428. set_common_target_properties(carla-water-files)
  429. target_compile_options(carla-water-files
  430. PRIVATE
  431. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-deprecated-copy>
  432. )
  433. target_include_directories(carla-water-files
  434. PRIVATE
  435. ../source/includes
  436. ../source/utils
  437. )
  438. target_link_libraries(carla-water-files
  439. PRIVATE
  440. $<$<BOOL:${APPLE}>:$<LINK_LIBRARY:FRAMEWORK,AppKit.framework>>
  441. $<$<BOOL:${WIN32}>:ole32>
  442. $<$<BOOL:${WIN32}>:winmm>
  443. ${CARLA_LIBDL}
  444. )
  445. target_sources(carla-water-files
  446. PRIVATE
  447. ../source/modules/water/water.files.cpp
  448. )
  449. #######################################################################################################################
  450. # ysfx
  451. add_library(carla-ysfx STATIC)
  452. add_library(carla::ysfx ALIAS carla-ysfx)
  453. set_common_target_properties(carla-ysfx)
  454. # YSFX_FTS_LACKS_LFS_SUPPORT
  455. target_compile_definitions(carla-ysfx
  456. PRIVATE
  457. EEL_TARGET_PORTABLE
  458. EELSCRIPT_NO_NET
  459. EELSCRIPT_NO_LICE
  460. NSEEL_ATOF=ysfx_wdl_atof
  461. WDL_FFT_REALSIZE=8
  462. WDL_LINEPARSE_ATOF=ysfx_wdl_atof
  463. WDL_WIN32_UTF8_NO_UI_IMPL
  464. YSFX_API=
  465. YSFX_NO_GFX
  466. YSFX_NO_STANDARD_MUTEX
  467. $<$<BOOL:${WIN32}>:NOMINMAX>
  468. $<$<NOT:$<BOOL:${MINGW}>>:_FILE_OFFSET_BITS=64>
  469. )
  470. # NOTE ugly -U /U due to cmake not supporting `target_remove_definitions`
  471. # see https://gitlab.kitware.com/cmake/cmake/-/issues/19796
  472. target_compile_options(carla-ysfx
  473. PRIVATE
  474. $<$<BOOL:${MINGW}>:-UUNICODE>
  475. $<$<BOOL:${MINGW}>:-U_UNICODE>
  476. $<$<BOOL:${MSVC}>:/wd4018>
  477. $<$<BOOL:${MSVC}>:/wd4297>
  478. $<$<BOOL:${MSVC}>:/UUNICODE>
  479. $<$<BOOL:${MSVC}>:/U_UNICODE>
  480. $<$<C_COMPILER_ID:GNU>:-Wno-extra>
  481. $<$<C_COMPILER_ID:GNU>:-Wno-ignored-attributes>
  482. $<$<C_COMPILER_ID:GNU>:-Wno-unused-function>
  483. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-fsigned-char>
  484. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-sign-compare>
  485. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  486. $<$<AND:$<COMPILE_LANGUAGE:C>,$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>>:-Wno-missing-field-initializers>
  487. $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wno-deprecated-copy>
  488. )
  489. target_include_directories(carla-ysfx
  490. PRIVATE
  491. ../source/modules/ysfx/include
  492. ../source/modules/ysfx/sources
  493. ../source/modules/ysfx/thirdparty/dr_libs
  494. ../source/modules/ysfx/thirdparty/stb
  495. ../source/modules/ysfx/thirdparty/WDL/source
  496. )
  497. target_sources(carla-ysfx
  498. PRIVATE
  499. ../source/modules/ysfx/sources/ysfx.cpp
  500. ../source/modules/ysfx/sources/ysfx_api_eel.cpp
  501. ../source/modules/ysfx/sources/ysfx_api_file.cpp
  502. ../source/modules/ysfx/sources/ysfx_api_gfx.cpp
  503. ../source/modules/ysfx/sources/ysfx_api_reaper.cpp
  504. ../source/modules/ysfx/sources/ysfx_audio_flac.cpp
  505. ../source/modules/ysfx/sources/ysfx_audio_wav.cpp
  506. ../source/modules/ysfx/sources/ysfx_config.cpp
  507. ../source/modules/ysfx/sources/ysfx_eel_utils.cpp
  508. ../source/modules/ysfx/sources/ysfx_midi.cpp
  509. ../source/modules/ysfx/sources/ysfx_parse.cpp
  510. ../source/modules/ysfx/sources/ysfx_reader.cpp
  511. ../source/modules/ysfx/sources/ysfx_utils.cpp
  512. ../source/modules/ysfx/sources/ysfx_utils_fts.cpp
  513. ../source/modules/ysfx/sources/eel2-gas/sources/asm-nseel-x64-sse.S
  514. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-caltab.c
  515. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-cfunc.c
  516. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-compiler.c
  517. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-eval.c
  518. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-lextab.c
  519. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-ram.c
  520. ../source/modules/ysfx/thirdparty/WDL/source/WDL/eel2/nseel-yylex.c
  521. ../source/modules/ysfx/thirdparty/WDL/source/WDL/fft.c
  522. $<$<BOOL:${WIN32}>:../source/modules/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c>
  523. )
  524. #######################################################################################################################
  525. # zita-resampler
  526. add_library(carla-zita-resampler STATIC)
  527. add_library(carla::zita-resampler ALIAS carla-zita-resampler)
  528. set_common_target_properties(carla-zita-resampler)
  529. target_compile_definitions(carla-zita-resampler
  530. PRIVATE
  531. $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
  532. )
  533. target_include_directories(carla-zita-resampler
  534. PRIVATE
  535. ../source/includes
  536. )
  537. target_link_libraries(carla-zita-resampler
  538. PRIVATE
  539. ${CARLA_PTHREADS}
  540. )
  541. target_sources(carla-zita-resampler
  542. PRIVATE
  543. ../source/modules/zita-resampler/cresampler.cc
  544. ../source/modules/zita-resampler/resampler-table.cc
  545. ../source/modules/zita-resampler/resampler.cc
  546. ../source/modules/zita-resampler/vresampler.cc
  547. )
  548. #######################################################################################################################
  549. # carla bridge
  550. add_executable(carla-bridge-native)
  551. set_common_target_properties(carla-bridge-native)
  552. target_compile_definitions(carla-bridge-native
  553. PRIVATE
  554. BUILD_BRIDGE
  555. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  556. )
  557. # FIXME
  558. target_compile_options(carla-bridge-native
  559. PRIVATE
  560. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  561. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  562. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  563. $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter>
  564. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  565. )
  566. target_include_directories(carla-bridge-native
  567. PRIVATE
  568. ../source
  569. ../source/backend
  570. ../source/backend/engine
  571. ../source/backend/plugin
  572. ../source/includes
  573. ../source/modules
  574. ../source/utils
  575. )
  576. target_link_libraries(carla-bridge-native
  577. PRIVATE
  578. carla-audio-decoder
  579. carla-jackbridge
  580. carla-lilv
  581. carla-native-plugins
  582. carla-rtmempool
  583. carla-sfzero
  584. carla-water
  585. carla-ysfx
  586. carla-zita-resampler
  587. PkgConfig::FLUIDSYNTH
  588. PkgConfig::LIBLO
  589. PkgConfig::LIBMAGIC
  590. PkgConfig::X11
  591. ${CARLA_PTHREADS}
  592. )
  593. target_sources(carla-bridge-native
  594. PRIVATE
  595. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  596. ../source/backend/CarlaStandalone.cpp
  597. ../source/backend/engine/CarlaEngine.cpp
  598. ../source/backend/engine/CarlaEngineBridge.cpp
  599. ../source/backend/engine/CarlaEngineClient.cpp
  600. ../source/backend/engine/CarlaEngineDummy.cpp
  601. ../source/backend/engine/CarlaEngineData.cpp
  602. ../source/backend/engine/CarlaEngineGraph.cpp
  603. ../source/backend/engine/CarlaEngineInternal.cpp
  604. ../source/backend/engine/CarlaEnginePorts.cpp
  605. ../source/backend/engine/CarlaEngineRunner.cpp
  606. ../source/backend/plugin/CarlaPlugin.cpp
  607. ../source/backend/plugin/CarlaPluginBridge.cpp
  608. ../source/backend/plugin/CarlaPluginInternal.cpp
  609. ../source/backend/plugin/CarlaPluginAU.cpp
  610. ../source/backend/plugin/CarlaPluginCLAP.cpp
  611. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  612. ../source/backend/plugin/CarlaPluginJuce.cpp
  613. ../source/backend/plugin/CarlaPluginJSFX.cpp
  614. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  615. ../source/backend/plugin/CarlaPluginLV2.cpp
  616. ../source/backend/plugin/CarlaPluginNative.cpp
  617. ../source/backend/plugin/CarlaPluginSFZero.cpp
  618. ../source/backend/plugin/CarlaPluginVST2.cpp
  619. ../source/backend/plugin/CarlaPluginVST3.cpp
  620. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  621. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  622. )
  623. #######################################################################################################################
  624. # carla discovery
  625. add_executable(carla-discovery-native)
  626. set_common_target_properties(carla-discovery-native)
  627. target_include_directories(carla-discovery-native
  628. PRIVATE
  629. ../source/backend
  630. ../source/includes
  631. ../source/modules
  632. ../source/utils
  633. )
  634. target_link_libraries(carla-discovery-native
  635. PRIVATE
  636. carla-lilv
  637. carla-water-files
  638. carla-ysfx
  639. PkgConfig::FLUIDSYNTH
  640. ${CARLA_PTHREADS}
  641. )
  642. target_sources(carla-discovery-native
  643. PRIVATE
  644. ../source/discovery/carla-discovery.cpp
  645. )
  646. #######################################################################################################################
  647. # carla standalone
  648. add_library(carla-standalone SHARED)
  649. add_library(carla::standalone ALIAS carla-standalone)
  650. set_common_target_properties(carla-standalone)
  651. set_target_properties(carla-standalone
  652. PROPERTIES
  653. OUTPUT_NAME carla_standalone2
  654. )
  655. target_compile_definitions(carla-standalone
  656. PRIVATE
  657. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  658. )
  659. # FIXME
  660. target_compile_options(carla-standalone
  661. PRIVATE
  662. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  663. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  664. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  665. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  666. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  667. )
  668. target_include_directories(carla-standalone
  669. PRIVATE
  670. ../source
  671. ../source/backend
  672. ../source/includes
  673. ../source/modules
  674. ../source/utils
  675. )
  676. target_link_libraries(carla-standalone
  677. PRIVATE
  678. carla-jackbridge
  679. carla-lilv
  680. carla-native-plugins
  681. carla-rtmempool
  682. carla-sfzero
  683. carla-water
  684. carla-ysfx
  685. carla-zita-resampler
  686. PkgConfig::FLUIDSYNTH
  687. PkgConfig::LIBLO
  688. PkgConfig::LIBMAGIC
  689. PkgConfig::X11
  690. ${CARLA_PTHREADS}
  691. )
  692. target_sources(carla-standalone
  693. PRIVATE
  694. ../source/backend/CarlaStandalone.cpp
  695. ../source/backend/CarlaStandaloneNSM.cpp
  696. ../source/backend/engine/CarlaEngine.cpp
  697. ../source/backend/engine/CarlaEngineClient.cpp
  698. ../source/backend/engine/CarlaEngineDummy.cpp
  699. ../source/backend/engine/CarlaEngineData.cpp
  700. ../source/backend/engine/CarlaEngineGraph.cpp
  701. ../source/backend/engine/CarlaEngineInternal.cpp
  702. ../source/backend/engine/CarlaEngineNative.cpp
  703. ../source/backend/engine/CarlaEngineOsc.cpp
  704. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  705. ../source/backend/engine/CarlaEngineOscSend.cpp
  706. ../source/backend/engine/CarlaEnginePorts.cpp
  707. ../source/backend/engine/CarlaEngineRunner.cpp
  708. ../source/backend/plugin/CarlaPlugin.cpp
  709. ../source/backend/plugin/CarlaPluginBridge.cpp
  710. ../source/backend/plugin/CarlaPluginInternal.cpp
  711. ../source/backend/plugin/CarlaPluginAU.cpp
  712. ../source/backend/plugin/CarlaPluginCLAP.cpp
  713. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  714. ../source/backend/plugin/CarlaPluginJuce.cpp
  715. ../source/backend/plugin/CarlaPluginJSFX.cpp
  716. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  717. ../source/backend/plugin/CarlaPluginLV2.cpp
  718. ../source/backend/plugin/CarlaPluginNative.cpp
  719. ../source/backend/plugin/CarlaPluginSFZero.cpp
  720. ../source/backend/plugin/CarlaPluginVST2.cpp
  721. ../source/backend/plugin/CarlaPluginVST3.cpp
  722. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  723. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  724. )
  725. #######################################################################################################################
  726. # carla utils
  727. add_library(carla-utils SHARED)
  728. add_library(carla::utils ALIAS carla-utils)
  729. set_common_target_properties(carla-utils)
  730. set_target_properties(carla-standalone
  731. PROPERTIES
  732. OUTPUT_NAME carla_utils
  733. )
  734. target_include_directories(carla-utils
  735. PRIVATE
  736. ../source
  737. ../source/backend
  738. ../source/includes
  739. ../source/modules
  740. ../source/utils
  741. )
  742. target_link_libraries(carla-utils
  743. PRIVATE
  744. carla-jackbridge
  745. carla-lilv
  746. carla-water-files
  747. carla-ysfx
  748. PkgConfig::FLUIDSYNTH
  749. PkgConfig::X11
  750. ${CARLA_PTHREADS}
  751. PUBLIC
  752. $<$<BOOL:${WIN32}>:winmm>
  753. )
  754. target_sources(carla-utils
  755. PRIVATE
  756. ../source/backend/utils/CachedPlugins.cpp
  757. ../source/backend/utils/CarlaUtils.cpp
  758. ../source/backend/utils/Information.cpp
  759. ../source/backend/utils/JUCE.cpp
  760. ../source/backend/utils/PipeClient.cpp
  761. ../source/backend/utils/PluginDiscovery.cpp
  762. ../source/backend/utils/System.cpp
  763. ../source/backend/utils/Windows.cpp
  764. )
  765. #######################################################################################################################
  766. if(APPLE)
  767. set_source_files_properties(
  768. ../source/backend/CarlaStandalone.cpp
  769. ../source/backend/plugin/CarlaPluginCLAP.cpp
  770. ../source/backend/plugin/CarlaPluginVST2.cpp
  771. ../source/backend/plugin/CarlaPluginVST3.cpp
  772. ../source/backend/utils/CarlaUtils.cpp
  773. ../source/backend/utils/Windows.cpp
  774. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  775. ../source/discovery/carla-discovery.cpp
  776. ../source/modules/water/water.cpp
  777. ../source/modules/water/water.files.cpp
  778. PROPERTIES COMPILE_FLAGS -ObjC++)
  779. endif()
  780. #######################################################################################################################