From e40d80821f5b5b6b2708a67263f70829293e84ce Mon Sep 17 00:00:00 2001 From: 7c00 Date: Tue, 12 Jul 2022 15:46:25 +0800 Subject: [PATCH] Fix esm --- CMakeLists.txt | 14 +++++--------- cmake/aubio.esm/CMakeLists.txt | 2 ++ cmake/aubio/CMakeLists.txt | 1 + examples/pitch.html | 4 ++-- package.json | 5 ++++- spec/aubio.spec.mjs | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 cmake/aubio.esm/CMakeLists.txt create mode 100644 cmake/aubio/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0798eed..78e10f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,15 +31,11 @@ set(source_files ${PROJECT_SOURCE_DIR}/src/tempo.cc ${PROJECT_SOURCE_DIR}/src/pitch.cc) -add_definitions(-DHAVE_CONFIG_H) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ - -s MODULARIZE=1 \ - -s EXPORT_ES6=1 \ - -s SINGLE_FILE=1 \ - -s EXPORT_NAME=aubio \ - -Oz --closure 1 --bind") - include_directories(src) include_directories(aubio/src) +add_definitions(-DHAVE_CONFIG_H) -add_executable(aubio ${source_files}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sMODULARIZE=1 -sEXPORT_NAME=aubio -Oz --bind") +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build) +add_subdirectory(cmake/aubio) +add_subdirectory(cmake/aubio.esm) diff --git a/cmake/aubio.esm/CMakeLists.txt b/cmake/aubio.esm/CMakeLists.txt new file mode 100644 index 0000000..3718b69 --- /dev/null +++ b/cmake/aubio.esm/CMakeLists.txt @@ -0,0 +1,2 @@ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sEXPORT_ES6=1") +add_executable(aubio.esm ${source_files}) diff --git a/cmake/aubio/CMakeLists.txt b/cmake/aubio/CMakeLists.txt new file mode 100644 index 0000000..dfc495a --- /dev/null +++ b/cmake/aubio/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(aubio ${source_files}) diff --git a/examples/pitch.html b/examples/pitch.html index 05bffbb..a311e4a 100644 --- a/examples/pitch.html +++ b/examples/pitch.html @@ -39,8 +39,8 @@ crossorigin="anonymous" controls > - -