Skip to content

Commit

Permalink
Fix CMake options
Browse files Browse the repository at this point in the history
  • Loading branch information
lindstro committed Sep 28, 2017
1 parent 37f968f commit 7ebc49e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 29 deletions.
40 changes: 38 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cmake_dependent_option(BUILD_SHARED_LIBS
"SHARED_LIBS_SUPPORTED" OFF)

# PIC is always on for shared libs. This allows it to be selectable for
# static libs
# static libs.
if(SHARED_LIBS_SUPPORTED)
cmake_dependent_option(ZFP_ENABLE_PIC
"Build with Position Independent Code" ON
Expand All @@ -108,11 +108,47 @@ option(ZFP_WITH_ALIGNED_ALLOC "Enabled aligned memory allocation" OFF)

option(ZFP_WITH_CACHE_TWOWAY "Use two-way skew-associative cache" OFF)

option(ZFP_WITH_CACHE_FASH_HASH
option(ZFP_WITH_CACHE_FAST_HASH
"Use a faster but more collision prone hash function" OFF)

option(ZFP_WITH_CACHE_PROFILE "Count cache misses" OFF)

# Handle compile-time macros

if((DEFINED ZFP_INT64) AND (DEFINED ZFP_INT64_SUFFIX))
list(APPEND zfp_defs ZFP_INT64=${ZFP_INT64})
list(APPEND zfp_defs ZFP_INT64_SUFFIX=${ZFP_INT64_SUFFIX})
endif()

if((DEFINED ZFP_UINT64) AND (DEFINED ZFP_UINT64_SUFFIX))
list(APPEND zfp_defs ZFP_UINT64=${ZFP_UINT64})
list(APPEND zfp_defs ZFP_UINT64_SUFFIX=${ZFP_UINT64_SUFFIX})
endif()

if(NOT (ZFP_BIT_STREAM_WORD_SIZE EQUAL 64))
list(APPEND zfp_defs BIT_STREAM_WORD_TYPE=uint${ZFP_BIT_STREAM_WORD_SIZE})
endif()

if(ZFP_WITH_BIT_STREAM_STRIDED)
list(APPEND zfp_defs BIT_STREAM_STRIDED)
endif()

if(ZFP_WITH_ALIGNED_ALLOC)
list(APPEND zfp_defs ZFP_ALIGNED_ALLOC)
endif()

if(ZFP_WITH_CACHE_TWOWAY)
list(APPEND zfp_defs ZFP_CACHE_TWOWAY)
endif()

if(ZFP_WITH_CACHE_FAST_HASH)
list(APPEND zfp_defs ZFP_CACHE_FAST_HASH)
endif()

if(ZFP_WITH_CACHE_PROFILE)
list(APPEND zfp_defs ZFP_CACHE_PROFILE)
endif()

#------------------------------------------------------------------------------#
# Add source code
#------------------------------------------------------------------------------#
Expand Down
27 changes: 0 additions & 27 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
set(zfp_defs)

if(NOT (ZFP_BIT_STREAM_WORD_SIZE EQUAL 64))
list(APPEND zfp_defs BIT_STREAM_WORD_TYPE=uint${ZFP_BIT_STREAM_WORD_SIZE})
endif()

if(ZFP_WITH_BIT_STREAM_STRIDED)
list(APPEND zfp_defs BIT_STREAM_STRIDED)
endif()

if(ZFP_WITH_ALIGNED_ALLOC)
list(APPEND zfp_defs ZFP_ALIGNED_ALLOC)
endif()

if(ZFP_WITH_CACHE_TWOWAY)
list(APPEND zfp_defs ZFP_CACHE_TWOWAY)
endif()

if(ZFP_WITH_CACHE_FASH_HASH)
list(APPEND zfp_defs ZFP_CACHE_FAST_HASH)
endif()

if(ZFP_WITH_CACHE_PROFILE)
list(APPEND zfp_defs ZFP_CACHE_PROFILE)
endif()

set(zfp_source
zfp.c
bitstream.c
traitsf.h traitsd.h block1.h block2.h block3.h

encode1f.c encode1d.c encode1i.c encode1l.c
decode1f.c decode1d.c decode1i.c decode1l.c
encode2f.c encode2d.c encode2i.c encode2l.c
Expand Down

0 comments on commit 7ebc49e

Please sign in to comment.