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.

813 lines
22KB

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