Skip to content

Commit

Permalink
Relax required CMake version back to 3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom94 committed Dec 15, 2021
1 parent 09a79d3 commit a1b93c3
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 @@ -20,7 +20,7 @@
# STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.17)

PROJECT(tiny-cuda-nn
VERSION 1.1
Expand Down Expand Up @@ -64,9 +64,11 @@ set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_EXTENSIONS OFF)
set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC)

get_directory_property(TCNN_HAS_PARENT PARENT_DIRECTORY)

if (DEFINED ENV{TCNN_CUDA_ARCHITECTURES})
message(STATUS "Obtained target architecture from environment variable TCNN_CUDA_ARCHITECTURES=$ENV{TCNN_CUDA_ARCHITECTURES}")
if (NOT PROJECT_IS_TOP_LEVEL)
if (TCNN_HAS_PARENT)
set(CMAKE_CUDA_ARCHITECTURES $ENV{TCNN_CUDA_ARCHITECTURES} PARENT_SCOPE)
endif()
set(CMAKE_CUDA_ARCHITECTURES $ENV{TCNN_CUDA_ARCHITECTURES})
Expand All @@ -77,7 +79,7 @@ else()
string(STRIP "${INSTALLED_GPU_CCS_1}" INSTALLED_GPU_CCS_2)
string(REPLACE " " ";" INSTALLED_GPU_CCS_3 "${INSTALLED_GPU_CCS_2}")
string(REPLACE "." "" CUDA_ARCH_LIST "${INSTALLED_GPU_CCS_3}")
if (NOT PROJECT_IS_TOP_LEVEL)
if (TCNN_HAS_PARENT)
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH_LIST} PARENT_SCOPE)
endif()
set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH_LIST})
Expand Down

0 comments on commit a1b93c3

Please sign in to comment.