Skip to content

Commit

Permalink
Merge pull request #100 from DARMA-tasking/99-only-use-cmake_position…
Browse files Browse the repository at this point in the history
…_independent_code-when-building-bindings

 #99: Only use `CMAKE_POSITION_INDEPENDENT_CODE` when building bindings
  • Loading branch information
nlslatt authored Aug 5, 2024
2 parents aa42d32 + 094b108 commit 23ac6ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ 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")
endif()
Expand All @@ -35,6 +32,11 @@ 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 23ac6ab

Please sign in to comment.