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.

1013 lines
28KB

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