Skip to content

Commit

Permalink
add fpic option for static lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lu1and10 committed Sep 5, 2024
1 parent ed79798 commit e2a0a4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ option(FINUFFT_USE_OPENMP "Whether to use OpenMP for parallelization. If disable
option(FINUFFT_USE_CPU "Whether to build the ordinary FINUFFT library (libfinufft)." ON)
option(FINUFFT_USE_CUDA "Whether to build CUDA accelerated FINUFFT library (libcufinufft). This is completely independent of the main FINUFFT library" OFF)
option(FINUFFT_STATIC_LINKING "If ON builds the static finufft library, if OFF build a shared finufft library." ON)
option(FINUFFT_STATIC_LINKING_PIC "Whether to build the FINUFFT static lib with -fPIC flag" OFF)
option(FINUFFT_BUILD_DEVEL "Whether to build development executables" OFF)
option(FINUFFT_BUILD_EXAMPLES "Whether to build the FINUFFT examples" OFF)
option(FINUFFT_BUILD_TESTS "Whether to build the FINUFFT tests" OFF)
Expand Down Expand Up @@ -242,6 +243,9 @@ function(set_finufft_options target)
endif()
target_link_libraries(${target} PRIVATE xsimd)
target_link_libraries(${target} PRIVATE ${FINUFFT_FFTLIBS})
if(FINUFFT_STATIC_LINKING AND FINUFFT_STATIC_LINKING_PIC)
set_property(TARGET ${target} PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
endfunction()

if(FINUFFT_USE_CPU)
Expand Down

0 comments on commit e2a0a4f

Please sign in to comment.