Skip to content

Commit

Permalink
Improve Emscripten WebAssembly support
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Dec 2, 2022
1 parent 2ac2eb9 commit 4af2280
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ set(PRIMESIEVE_SOVERSION "11.0.0")
# Build options ######################################################

option(BUILD_PRIMESIEVE "Build primesieve binary" ON)
option(BUILD_SHARED_LIBS "Build shared libprimesieve" ON)
option(BUILD_STATIC_LIBS "Build static libprimesieve" ON)
option(BUILD_DOC "Build C/C++ API documentation" OFF)
option(BUILD_MANPAGE "Regenerate man page using a2x" OFF)
option(BUILD_EXAMPLES "Build example programs" OFF)
option(BUILD_TESTS "Build test programs" OFF)

# By default we enable building the shared libprimesieve library.
# However, the Emscripten WebAssembly compiler does not
# support shared libraries, hence we disable building the
# shared libprimesieve when using Emscripten.
get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
if(SHARED_LIBS_SUPPORTED)
option(BUILD_SHARED_LIBS "Build shared libprimesieve" ON)
else()
option(BUILD_SHARED_LIBS "Build shared libprimesieve" OFF)
endif()

option(WITH_MULTIARCH "Enable runtime dispatching to fastest supported CPU instruction set" ON)
option(WITH_MSVC_CRT_STATIC "Link primesieve.lib with /MT instead of the default /MD" OFF)

Expand Down
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Changes in version 11.0, 16/10/2022
Changes in version 11.0, 02/12/2022
===================================

The primesieve major version has been increased from 8 to 11 in order
Expand All @@ -22,6 +22,7 @@ primesieve_skipto(iter, start, stop) excludes the start number
requires up to 2x less start number corrections (e.g. start-1) compared
to primesieve_skipto().

* CMakeLists.txt: Improve Emscripten WebAssembly support.
* iterator.cpp: Add new primesieve::iterator::jump_to().
* iterator.cpp: Fix use after free in primesieve::iterator::clear().
* iterator-c.cpp: Add new primesieve_jump_to().
Expand Down

0 comments on commit 4af2280

Please sign in to comment.