clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit 395ab2bc5abd76f613b7ac3e4292b4e315700749
parent 3189bdfaf849eadeb5a0149bf3e2cb9fd0690518
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Wed, 15 Jun 2022 22:38:09 +0200

Merge pull request #100 from free-audio/next

1.0.2
Diffstat:
MCMakeLists.txt | 90+++++++++++++++++++++++++++++++++++++++++--------------------------------------
MCMakePresets.json | 4++++
MChangeLog.md | 13+++++++++----
Minclude/clap/version.h | 2+-
4 files changed, 61 insertions(+), 48 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.17) enable_testing() project(CLAP C CXX) -add_custom_target(clap-tests) +option(CLAP_BUILD_TESTS "Should CLAP build tests and the like?" OFF) # If you use clap as a submodule of your plugin you need some interface projects # to allow you to link. clap-core gives you the include directory and clap-plugin-core @@ -12,53 +12,57 @@ target_include_directories(clap-core INTERFACE include) install(DIRECTORY include DESTINATION "." OPTIONAL EXCLUDE_FROM_ALL) -add_executable(clap-compile-c EXCLUDE_FROM_ALL src/main.c) +if (${CLAP_BUILD_TESTS}) + message(STATUS "Including CLAP tests, compile tests, and versions") + add_custom_target(clap-tests) -macro(clap_compile_cpp SUFFIX EXT STDC STDCPP) - add_executable(clap-compile-${SUFFIX} EXCLUDE_FROM_ALL src/main.${EXT}) - target_link_libraries(clap-compile-${SUFFIX} clap-core) - set_target_properties(clap-compile-${SUFFIX} PROPERTIES - C_STANDARD ${STDC} - CXX_STANDARD ${STDCPP}) - add_test(NAME test-clap-compile-${SUFFIX} COMMAND clap-compile-${SUFFIX}) - add_dependencies(clap-tests clap-compile-${SUFFIX}) + macro(clap_compile_cpp SUFFIX EXT STDC STDCPP) + add_executable(clap-compile-${SUFFIX} EXCLUDE_FROM_ALL src/main.${EXT}) + target_link_libraries(clap-compile-${SUFFIX} clap-core) + set_target_properties(clap-compile-${SUFFIX} PROPERTIES + C_STANDARD ${STDC} + CXX_STANDARD ${STDCPP}) + add_test(NAME test-clap-compile-${SUFFIX} COMMAND clap-compile-${SUFFIX}) + add_dependencies(clap-tests clap-compile-${SUFFIX}) - if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") - target_compile_options(clap-compile-${SUFFIX} PRIVATE -Wall -Wextra -pedantic) - endif() + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + target_compile_options(clap-compile-${SUFFIX} PRIVATE -Wall -Wextra -pedantic) + endif() - if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang") - target_compile_options(clap-compile-${SUFFIX} PRIVATE -Werror=pragma-pack) - endif() -endmacro() + if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang") + target_compile_options(clap-compile-${SUFFIX} PRIVATE -Werror=pragma-pack) + endif() + endmacro() -clap_compile_cpp(c11 c 11 11) -clap_compile_cpp(cpp11 cc 11 11) -clap_compile_cpp(cpp14 cc 11 14) -clap_compile_cpp(c17 c 17 17) -clap_compile_cpp(cpp17 cc 17 17) -clap_compile_cpp(cpp20 cc 17 20) + clap_compile_cpp(c11 c 11 11) + clap_compile_cpp(cpp11 cc 11 11) + clap_compile_cpp(cpp14 cc 11 14) + clap_compile_cpp(c17 c 17 17) + clap_compile_cpp(cpp17 cc 17 17) + clap_compile_cpp(cpp20 cc 17 20) -add_library(clap-plugin-template MODULE EXCLUDE_FROM_ALL src/plugin-template.c) -target_link_libraries(clap-plugin-template PRIVATE clap-core) -set_target_properties(clap-plugin-template PROPERTIES C_STANDARD 11) + add_library(clap-plugin-template MODULE EXCLUDE_FROM_ALL src/plugin-template.c) + target_link_libraries(clap-plugin-template PRIVATE clap-core) + set_target_properties(clap-plugin-template PROPERTIES C_STANDARD 11) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - target_link_libraries(clap-plugin-template PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/linux-my_plug.version) - target_link_libraries(clap-plugin-template PRIVATE -Wl,-z,defs) - set_target_properties(clap-plugin-template PROPERTIES SUFFIX ".clap" PREFIX "") -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_link_options(clap-plugin-template PRIVATE -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/src/macos-symbols.txt) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + target_link_libraries(clap-plugin-template PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/linux-my_plug.version) + target_link_libraries(clap-plugin-template PRIVATE -Wl,-z,defs) + set_target_properties(clap-plugin-template PROPERTIES SUFFIX ".clap" PREFIX "") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_link_options(clap-plugin-template PRIVATE -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/src/macos-symbols.txt) - set_target_properties(clap-plugin-template PROPERTIES - BUNDLE True - BUNDLE_EXTENSION clap - MACOSX_BUNDLE_GUI_IDENTIFIER com.my_company.my_plug - MACOSX_BUNDLE_BUNDLE_NAME my_plug - MACOSX_BUNDLE_BUNDLE_VERSION "1" - MACOSX_BUNDLE_SHORT_VERSION_STRING "1" - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/plugins.plist.in - ) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set_target_properties(clap-plugin-template PROPERTIES SUFFIX ".clap" PREFIX "") + set_target_properties(clap-plugin-template PROPERTIES + BUNDLE True + BUNDLE_EXTENSION clap + MACOSX_BUNDLE_GUI_IDENTIFIER com.my_company.my_plug + MACOSX_BUNDLE_BUNDLE_NAME my_plug + MACOSX_BUNDLE_BUNDLE_VERSION "1" + MACOSX_BUNDLE_SHORT_VERSION_STRING "1" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/plugins.plist.in + ) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + target_link_options(clap-plugin-template PRIVATE /EXPORT:clap_entry) + set_target_properties(clap-plugin-template PROPERTIES SUFFIX ".clap" PREFIX "") + endif() endif() diff --git a/CMakePresets.json b/CMakePresets.json @@ -16,6 +16,10 @@ "CMAKE_EXPORT_COMPILE_COMMANDS": { "type": "boolean", "value": true + }, + "CLAP_BUILD_TESTS": { + "type": "boolean", + "value": true } } } diff --git a/ChangeLog.md b/ChangeLog.md @@ -1,4 +1,9 @@ -## Changes in 1.0.1 +# Changes in 1.0.2 + +* CMake: add `CLAP_BUILD_TESTS` which enables the tests. +* Fixes compilation for Visual Studio 2019 and GCC9. + +# Changes in 1.0.1 * [gui.h](include/clap/ext/gui.h): fix doc: set_scale must be provided * [events.h](include/clap/events.h): remove `clap_event_type` which was never used @@ -6,9 +11,9 @@ * [draft/tuning.h](include/clap/ext/draft/tuning.h): rename `clap_client_tuning` to `clap_plugin_tuning` * [macros.h](include/clap/private/macros.h): fix compatibility with C17 -## Changes in 1.0.0 +# Changes in 1.0.0 -# New stable interfaces +## New stable interfaces * [audio-ports-config.h](include/clap/ext/audio-ports-config.h) * [audio-ports.h](include/clap/ext/audio-ports.h) @@ -27,7 +32,7 @@ * [thread-pool.h](include/clap/ext/thread-pool.h) * [timer-support.h](include/clap/ext/time-support.h) -# New draft interfaces +## New draft interfaces * [ambisonic.h](include/clap/ext/draft/ambisonic.h) * [check-for-update.h](include/clap/ext/draft/check-for-update.h) diff --git a/include/clap/version.h b/include/clap/version.h @@ -22,7 +22,7 @@ typedef struct clap_version { #define CLAP_VERSION_MAJOR ((uint32_t)1) #define CLAP_VERSION_MINOR ((uint32_t)0) -#define CLAP_VERSION_REVISION ((uint32_t)1) +#define CLAP_VERSION_REVISION ((uint32_t)2) #define CLAP_VERSION_INIT {CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION} static const CLAP_CONSTEXPR clap_version_t CLAP_VERSION = CLAP_VERSION_INIT;