Skip to content

Commit cd4b5cd

Browse files
committed
release: Bump version to 1.0.2 with build system and header improvements
- Bump version to 1.0.2 in CMakeLists.txt, src/sonare.h, bindings/python/pyproject.toml, and package.json - Refactor warning flags from global add_compile_options() to per-target SONARE_WARNING_FLAGS variable applied via target_compile_options() in src/, tests/, and tools/ to prevent warnings from propagating into third-party targets - Add feature/cqt.h, feature/pitch.h, and feature/vqt.h to public includes in src/sonare.h - Add POSITION_INDEPENDENT_CODE ON to shared library target in src/CMakeLists.txt - Add -DCMAKE_BUILD_TYPE=Release to WASM build script in package.json - Add release to .PHONY targets in Makefile - Cast RAND_MAX to float in hpss_test.cpp to fix implicit conversion warning
1 parent e46eb41 commit cd4b5cd

9 files changed

Lines changed: 22 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(libsonare VERSION 1.0.1 LANGUAGES C CXX)
2+
project(libsonare VERSION 1.0.2 LANGUAGES C CXX)
33

44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -19,12 +19,11 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
1919
# compile_commands.json
2020
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2121

22-
# 警告設定
23-
if(MSVC)
24-
add_compile_options(/W4 /WX)
25-
else()
26-
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
27-
endif()
22+
# 警告設定 (サードパーティに波及させないためターゲット単位で適用)
23+
set(SONARE_WARNING_FLAGS
24+
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
25+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror>
26+
)
2827

2928
# Coverage settings
3029
if(ENABLE_COVERAGE)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all build test clean rebuild format wasm coverage coverage-build coverage-clean \
1+
.PHONY: all build release test clean rebuild format wasm coverage coverage-build coverage-clean \
22
build-shared build-node test-python test-node
33

44
BUILD_DIR := build

bindings/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "libsonare"
7-
version = "1.0.1"
7+
version = "1.0.2"
88
description = "Fast audio analysis library — librosa-like API, tens of times faster (C++ with Python bindings)"
99
requires-python = ">=3.11"
1010
license = "Apache-2.0"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@libraz/libsonare",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"type": "module",
55
"packageManager": "yarn@4.12.0",
66
"description": "Audio analysis library for music information retrieval",
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"prepare": "simple-git-hooks || true",
2323
"build": "yarn build:wasm && yarn build:js",
24-
"build:wasm": "emcmake cmake -B build-wasm -DBUILD_WASM=ON && cmake --build build-wasm",
24+
"build:wasm": "emcmake cmake -B build-wasm -DBUILD_WASM=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build-wasm",
2525
"build:js": "tsc",
2626
"clean": "rm -rf dist build-wasm",
2727
"lint": "biome check js/ tests/wasm/ bindings/node/src/ bindings/node/tests/",

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ target_include_directories(sonare_core PUBLIC
6969
)
7070

7171
target_link_libraries(sonare_core PUBLIC Eigen3::Eigen kissfft)
72+
target_compile_options(sonare_core PRIVATE ${SONARE_WARNING_FLAGS})
7273

7374
# Threading support for parallel analysis on native builds
7475
if(NOT BUILD_WASM)
@@ -83,6 +84,7 @@ if(BUILD_SHARED)
8384
OUTPUT_NAME sonare
8485
VERSION ${PROJECT_VERSION}
8586
SOVERSION 1
87+
POSITION_INDEPENDENT_CODE ON
8688
)
8789
target_include_directories(sonare_shared PUBLIC
8890
${CMAKE_CURRENT_SOURCE_DIR}
@@ -92,6 +94,7 @@ if(BUILD_SHARED)
9294
${CMAKE_SOURCE_DIR}/third_party/r8brain
9395
)
9496
target_link_libraries(sonare_shared PUBLIC Eigen3::Eigen kissfft)
97+
target_compile_options(sonare_shared PRIVATE ${SONARE_WARNING_FLAGS})
9598
if(NOT BUILD_WASM)
9699
target_link_libraries(sonare_shared PUBLIC Threads::Threads)
97100
endif()

src/sonare.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// Version information
88
#define SONARE_VERSION_MAJOR 1
99
#define SONARE_VERSION_MINOR 0
10-
#define SONARE_VERSION_PATCH 1
11-
#define SONARE_VERSION_STRING "1.0.1"
10+
#define SONARE_VERSION_PATCH 2
11+
#define SONARE_VERSION_STRING "1.0.2"
1212

1313
// Utility
1414
#include "util/exception.h"
@@ -32,9 +32,12 @@
3232

3333
// Features
3434
#include "feature/chroma.h"
35+
#include "feature/cqt.h"
3536
#include "feature/mel_spectrogram.h"
3637
#include "feature/onset.h"
38+
#include "feature/pitch.h"
3739
#include "feature/spectral.h"
40+
#include "feature/vqt.h"
3841

3942
// Effects
4043
#include "effects/hpss.h"

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ add_executable(sonare_tests
6666
)
6767

6868
target_link_libraries(sonare_tests PRIVATE sonare_core Catch2::Catch2WithMain)
69+
target_compile_options(sonare_tests PRIVATE ${SONARE_WARNING_FLAGS})
6970
target_include_directories(sonare_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
7071

7172
include(CTest)

tests/effects/hpss_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Audio create_percussive_audio(int sr = 22050, float duration = 0.5f, int n_click
3939
int start = c * interval;
4040
for (int i = 0; i < click_length && start + i < n_samples; ++i) {
4141
float envelope = 1.0f - static_cast<float>(i) / click_length;
42-
samples[start + i] = envelope * (static_cast<float>(std::rand()) / RAND_MAX * 2.0f - 1.0f);
42+
samples[start + i] =
43+
envelope * (static_cast<float>(std::rand()) / static_cast<float>(RAND_MAX) * 2.0f - 1.0f);
4344
}
4445
}
4546

tools/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
add_executable(sonare sonare_cli.cpp)
33

44
target_link_libraries(sonare PRIVATE sonare_core)
5+
target_compile_options(sonare PRIVATE ${SONARE_WARNING_FLAGS})
56

67
target_include_directories(sonare PRIVATE
78
${CMAKE_SOURCE_DIR}/src

0 commit comments

Comments
 (0)