Skip to content

Commit

Permalink
This improves the runtime dispatching. (#43)
Browse files Browse the repository at this point in the history
* This improves the runtime dispatching.

* Upgrading VS

* Updating.
  • Loading branch information
lemire authored Aug 6, 2022
1 parent 0fa291b commit 18142e5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/vs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: VS16-CI
name: VS17-CI

on:
push:
Expand All @@ -13,16 +13,16 @@ jobs:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
name: windows-vs16
name: windows-vs17
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- {gen: Visual Studio 16 2019, arch: Win32, static: ON}
- {gen: Visual Studio 16 2019, arch: Win32, static: OFF}
- {gen: Visual Studio 16 2019, arch: x64, static: ON}
- {gen: Visual Studio 16 2019, arch: x64, static: OFF}
- {gen: Visual Studio 17 2022, arch: Win32, static: ON}
- {gen: Visual Studio 17 2022, arch: Win32, static: OFF}
- {gen: Visual Studio 17 2022, arch: x64, static: ON}
- {gen: Visual Studio 17 2022, arch: x64, static: OFF}
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
24 changes: 19 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
cmake_minimum_required(VERSION 3.3)
set(CMAKE_MACOSX_RPATH OFF)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()

project(STREAMVBYTE VERSION "1.0.0")

set(STREAMVBYTE_LIB_VERSION "1.0.0" CACHE STRING "streamvbyte library version")
set(STREAMVBYTE_LIB_SOVERSION "1" CACHE STRING "streamvbyte library soversion")

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
option(STREAMVBYTE_SANITIZE "Sanitize addresses" OFF)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected")
if(STREAMVBYTE_SANITIZE)
message(STATUS "Default to Debug")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
else()
message(STATUS "Default to Release")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
endif()
endif()

if(STREAMVBYTE_SANITIZE)
message(STATUS "Enabling memory sanitizer.")
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fno-sanitize-recover=all)
add_compile_definitions(ASAN_OPTIONS=detect_leaks=1)
endif()

if (MSVC)
add_definitions(
"-D__restrict__=__restrict"
Expand Down Expand Up @@ -70,6 +83,7 @@ install(
TARGETS streamvbyte streamvbyte_static
DESTINATION lib)


option(STREAMVBYTE_SANITIZE_UNDEFINED "Sanitize undefined behavior" OFF)
if(STREAMVBYTE_SANITIZE_UNDEFINED)
add_compile_options(-fsanitize=undefined -fno-sanitize-recover=all)
Expand Down
2 changes: 1 addition & 1 deletion src/streamvbyte_isadetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static inline bool streamvbyte_ssse3() {
}
#else
static inline bool streamvbyte_ssse3() {
return (dynamic_streamvbyte_detect_supported_architectures() & streamvbyte_SSSE3) == streamvbyte_SSSE3;
return (streamvbyte_detect_supported_architectures() & streamvbyte_SSSE3) == streamvbyte_SSSE3;
}
#endif

Expand Down

0 comments on commit 18142e5

Please sign in to comment.