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.

1029 lines
29KB

  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
  556. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  557. )
  558. target_compile_definitions(carla-bridge-native
  559. PRIVATE
  560. BUILD_BRIDGE
  561. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  562. )
  563. # FIXME
  564. target_compile_options(carla-bridge-native
  565. PRIVATE
  566. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  567. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  568. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  569. $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter>
  570. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  571. )
  572. target_include_directories(carla-bridge-native
  573. PRIVATE
  574. ../source
  575. ../source/backend
  576. ../source/backend/engine
  577. ../source/backend/plugin
  578. ../source/includes
  579. ../source/modules
  580. ../source/utils
  581. )
  582. target_link_libraries(carla-bridge-native
  583. PRIVATE
  584. carla-audio-decoder
  585. carla-jackbridge
  586. carla-lilv
  587. carla-native-plugins
  588. carla-rtmempool
  589. carla-sfzero
  590. carla-water
  591. carla-ysfx
  592. carla-zita-resampler
  593. PkgConfig::FLUIDSYNTH
  594. PkgConfig::LIBLO
  595. PkgConfig::LIBMAGIC
  596. PkgConfig::X11
  597. ${CARLA_PTHREADS}
  598. )
  599. target_sources(carla-bridge-native
  600. PRIVATE
  601. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  602. ../source/backend/CarlaStandalone.cpp
  603. ../source/backend/engine/CarlaEngine.cpp
  604. ../source/backend/engine/CarlaEngineBridge.cpp
  605. ../source/backend/engine/CarlaEngineClient.cpp
  606. ../source/backend/engine/CarlaEngineDummy.cpp
  607. ../source/backend/engine/CarlaEngineData.cpp
  608. ../source/backend/engine/CarlaEngineGraph.cpp
  609. ../source/backend/engine/CarlaEngineInternal.cpp
  610. ../source/backend/engine/CarlaEnginePorts.cpp
  611. ../source/backend/engine/CarlaEngineRunner.cpp
  612. ../source/backend/plugin/CarlaPlugin.cpp
  613. ../source/backend/plugin/CarlaPluginBridge.cpp
  614. ../source/backend/plugin/CarlaPluginInternal.cpp
  615. ../source/backend/plugin/CarlaPluginAU.cpp
  616. ../source/backend/plugin/CarlaPluginCLAP.cpp
  617. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  618. ../source/backend/plugin/CarlaPluginJuce.cpp
  619. ../source/backend/plugin/CarlaPluginJSFX.cpp
  620. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  621. ../source/backend/plugin/CarlaPluginLV2.cpp
  622. ../source/backend/plugin/CarlaPluginNative.cpp
  623. ../source/backend/plugin/CarlaPluginSFZero.cpp
  624. ../source/backend/plugin/CarlaPluginVST2.cpp
  625. ../source/backend/plugin/CarlaPluginVST3.cpp
  626. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  627. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  628. )
  629. #######################################################################################################################
  630. # carla discovery
  631. add_executable(carla-discovery-native)
  632. set_common_target_properties(carla-discovery-native)
  633. install(TARGETS carla-discovery-native
  634. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  635. )
  636. target_include_directories(carla-discovery-native
  637. PRIVATE
  638. ../source/backend
  639. ../source/includes
  640. ../source/modules
  641. ../source/utils
  642. )
  643. target_link_libraries(carla-discovery-native
  644. PRIVATE
  645. carla-lilv
  646. carla-water-files
  647. carla-ysfx
  648. PkgConfig::FLUIDSYNTH
  649. ${CARLA_PTHREADS}
  650. )
  651. target_sources(carla-discovery-native
  652. PRIVATE
  653. ../source/discovery/carla-discovery.cpp
  654. )
  655. #######################################################################################################################
  656. # carla standalone
  657. add_library(carla-standalone SHARED)
  658. add_library(carla::standalone ALIAS carla-standalone)
  659. set_common_target_properties(carla-standalone)
  660. install(TARGETS carla-standalone
  661. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla
  662. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla
  663. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  664. )
  665. set_target_properties(carla-standalone
  666. PROPERTIES
  667. OUTPUT_NAME carla_standalone2
  668. PREFIX lib
  669. SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}
  670. )
  671. target_compile_definitions(carla-standalone
  672. PRIVATE
  673. CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
  674. )
  675. # FIXME
  676. target_compile_options(carla-standalone
  677. PRIVATE
  678. $<$<C_COMPILER_ID:AppleClang>:-Wno-unused-but-set-variable>
  679. $<$<C_COMPILER_ID:GNU>:-Wno-format-truncation>
  680. $<$<C_COMPILER_ID:GNU>:-Wno-stringop-overflow>
  681. $<$<C_COMPILER_ID:GNU>:-Wno-error=cpp>
  682. $<$<STREQUAL:${CMAKE_C_COMPILER_FRONTEND_VARIANT},GNU>:-Wno-unused-parameter>
  683. )
  684. target_include_directories(carla-standalone
  685. PRIVATE
  686. ../source
  687. ../source/backend
  688. ../source/includes
  689. ../source/modules
  690. ../source/utils
  691. )
  692. target_link_libraries(carla-standalone
  693. PRIVATE
  694. carla-jackbridge
  695. carla-lilv
  696. carla-native-plugins
  697. carla-rtmempool
  698. carla-sfzero
  699. carla-water
  700. carla-ysfx
  701. carla-zita-resampler
  702. PkgConfig::FLUIDSYNTH
  703. PkgConfig::LIBLO
  704. PkgConfig::LIBMAGIC
  705. PkgConfig::X11
  706. ${CARLA_PTHREADS}
  707. )
  708. target_sources(carla-standalone
  709. PRIVATE
  710. ../source/backend/CarlaStandalone.cpp
  711. ../source/backend/CarlaStandaloneNSM.cpp
  712. ../source/backend/engine/CarlaEngine.cpp
  713. ../source/backend/engine/CarlaEngineClient.cpp
  714. ../source/backend/engine/CarlaEngineDummy.cpp
  715. ../source/backend/engine/CarlaEngineData.cpp
  716. ../source/backend/engine/CarlaEngineGraph.cpp
  717. ../source/backend/engine/CarlaEngineInternal.cpp
  718. ../source/backend/engine/CarlaEngineNative.cpp
  719. ../source/backend/engine/CarlaEngineOsc.cpp
  720. ../source/backend/engine/CarlaEngineOscHandlers.cpp
  721. ../source/backend/engine/CarlaEngineOscSend.cpp
  722. ../source/backend/engine/CarlaEnginePorts.cpp
  723. ../source/backend/engine/CarlaEngineRunner.cpp
  724. ../source/backend/plugin/CarlaPlugin.cpp
  725. ../source/backend/plugin/CarlaPluginBridge.cpp
  726. ../source/backend/plugin/CarlaPluginInternal.cpp
  727. ../source/backend/plugin/CarlaPluginAU.cpp
  728. ../source/backend/plugin/CarlaPluginCLAP.cpp
  729. ../source/backend/plugin/CarlaPluginFluidSynth.cpp
  730. ../source/backend/plugin/CarlaPluginJuce.cpp
  731. ../source/backend/plugin/CarlaPluginJSFX.cpp
  732. ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  733. ../source/backend/plugin/CarlaPluginLV2.cpp
  734. ../source/backend/plugin/CarlaPluginNative.cpp
  735. ../source/backend/plugin/CarlaPluginSFZero.cpp
  736. ../source/backend/plugin/CarlaPluginVST2.cpp
  737. ../source/backend/plugin/CarlaPluginVST3.cpp
  738. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/engine/CarlaEngineJack.cpp>
  739. $<$<BOOL:${CARLA_USE_JACK}>:../source/backend/plugin/CarlaPluginJack.cpp>
  740. )
  741. #######################################################################################################################
  742. # carla utils
  743. add_library(carla-utils SHARED)
  744. add_library(carla::utils ALIAS carla-utils)
  745. set_common_target_properties(carla-utils)
  746. install(TARGETS carla-utils
  747. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla
  748. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla
  749. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  750. )
  751. set_target_properties(carla-utils
  752. PROPERTIES
  753. OUTPUT_NAME carla_utils
  754. PREFIX lib
  755. SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}
  756. )
  757. target_include_directories(carla-utils
  758. PRIVATE
  759. ../source
  760. ../source/backend
  761. ../source/includes
  762. ../source/modules
  763. ../source/utils
  764. )
  765. target_link_libraries(carla-utils
  766. PRIVATE
  767. carla-jackbridge
  768. carla-lilv
  769. carla-water-files
  770. carla-ysfx
  771. PkgConfig::FLUIDSYNTH
  772. PkgConfig::X11
  773. ${CARLA_PTHREADS}
  774. PUBLIC
  775. $<$<BOOL:${WIN32}>:winmm>
  776. )
  777. target_sources(carla-utils
  778. PRIVATE
  779. ../source/backend/utils/CachedPlugins.cpp
  780. ../source/backend/utils/CarlaUtils.cpp
  781. ../source/backend/utils/Information.cpp
  782. ../source/backend/utils/JUCE.cpp
  783. ../source/backend/utils/PipeClient.cpp
  784. ../source/backend/utils/PluginDiscovery.cpp
  785. ../source/backend/utils/System.cpp
  786. ../source/backend/utils/Windows.cpp
  787. )
  788. #######################################################################################################################
  789. if(APPLE)
  790. set_source_files_properties(
  791. ../source/backend/CarlaStandalone.cpp
  792. ../source/backend/plugin/CarlaPluginCLAP.cpp
  793. ../source/backend/plugin/CarlaPluginVST2.cpp
  794. ../source/backend/plugin/CarlaPluginVST3.cpp
  795. ../source/backend/utils/CarlaUtils.cpp
  796. ../source/backend/utils/Windows.cpp
  797. ../source/bridges-plugin/CarlaBridgePlugin.cpp
  798. ../source/discovery/carla-discovery.cpp
  799. ../source/modules/water/water.cpp
  800. ../source/modules/water/water.files.cpp
  801. PROPERTIES COMPILE_FLAGS -ObjC++)
  802. endif()
  803. #######################################################################################################################
  804. # install code headers
  805. add_library(carla-headers-backend INTERFACE)
  806. add_library(carla-headers-includes INTERFACE)
  807. add_library(carla-headers-utils INTERFACE)
  808. set_property(TARGET carla-headers-backend
  809. PROPERTY PUBLIC_HEADER
  810. ../source/backend/CarlaBackend.h
  811. ../source/backend/CarlaHost.h
  812. ../source/backend/CarlaUtils.h
  813. ../source/backend/CarlaEngine.hpp
  814. ../source/backend/CarlaPlugin.hpp
  815. ../source/backend/CarlaPluginPtr.hpp
  816. )
  817. set_property(TARGET carla-headers-includes
  818. PROPERTY PUBLIC_HEADER
  819. ../source/includes/CarlaDefines.h
  820. ../source/includes/CarlaMIDI.h
  821. ../source/includes/CarlaNative.h
  822. ../source/includes/CarlaNativePlugin.h
  823. )
  824. set_property(TARGET carla-headers-utils
  825. PROPERTY PUBLIC_HEADER
  826. ../source/utils/CarlaBackendUtils.hpp
  827. ../source/utils/CarlaBase64Utils.hpp
  828. ../source/utils/CarlaBinaryUtils.hpp
  829. ../source/utils/CarlaBridgeDefines.hpp
  830. ../source/utils/CarlaBridgeUtils.hpp
  831. ../source/utils/CarlaMacUtils.hpp
  832. ../source/utils/CarlaMathUtils.hpp
  833. ../source/utils/CarlaMutex.hpp
  834. ../source/utils/CarlaRingBuffer.hpp
  835. ../source/utils/CarlaProcessUtils.hpp
  836. ../source/utils/CarlaRunner.hpp
  837. ../source/utils/CarlaScopeUtils.hpp
  838. ../source/utils/CarlaSemUtils.hpp
  839. ../source/utils/CarlaSha1Utils.hpp
  840. ../source/utils/CarlaShmUtils.hpp
  841. ../source/utils/CarlaString.hpp
  842. ../source/utils/CarlaThread.hpp
  843. ../source/utils/CarlaTimeUtils.hpp
  844. ../source/utils/CarlaUtils.hpp
  845. )
  846. install(TARGETS carla-headers-backend PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla)
  847. install(TARGETS carla-headers-includes PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/includes)
  848. install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/carla/utils)
  849. #######################################################################################################################
  850. # pkg-config stuff
  851. configure_file(carla-utils.pc.in carla-utils.pc @ONLY)
  852. install(FILES
  853. ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc
  854. DESTINATION
  855. ${CMAKE_INSTALL_LIBDIR}/pkgconfig
  856. )
  857. #######################################################################################################################