Skip to content

Commit

Permalink
#99: wrap CMAKE_POSITION_INDEPENDENT_CODE in if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Aug 5, 2024
1 parent aa42d32 commit 446d527
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ set(
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# add -fPIC to all targets
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")
endif()
message(STATUS "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}")

option(VT_TV_PYTHON_BINDINGS_ENABLED "Build vt-tv with Python bindings" OFF)
option(VT_TV_OPENMP_ENABLED "Build vt-tv with openMP support" ON)

# add -fPIC to all targets (if building with nanobind)
if(VT_TV_PYTHON_BINDINGS_ENABLED)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

option(VT_TV_WERROR_ENABLED "Build vt-tv with warnings as errors" OFF)

set(VT_TV_N_THREADS "2" CACHE STRING "Number of OpenMP threads to use")
Expand Down

0 comments on commit 446d527

Please sign in to comment.