Skip to content

Commit

Permalink
make 'on' for BLT TPLs sticky
Browse files Browse the repository at this point in the history
  • Loading branch information
white238 committed Mar 5, 2024
1 parent 97107ed commit e9c33bc
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions cmake/BLTSetupTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,36 @@ if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/BLTThirdPartyConfigFlags.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/BLTThirdPartyConfigFlags.cmake")
else()
# Case: Main BLT project (ie. a project loading it's own BLT)
set(BLT_ENABLE_HIP ${ENABLE_HIP})
set(BLT_ENABLE_CUDA ${ENABLE_CUDA})
set(BLT_ENABLE_MPI ${ENABLE_MPI})
set(BLT_ENABLE_OPENMP ${ENABLE_OPENMP})
set(BLT_ENABLE_FIND_MPI ${ENABLE_FIND_MPI})
set(BLT_ENABLE_CLANG_CUDA ${ENABLE_CLANG_CUDA})
#
# Always stay enabled if any upstream has already turned you on.
if(NOT BLT_ENABLE_HIP)
set(BLT_ENABLE_HIP ${ENABLE_HIP})
endif()
if(NOT BLT_ENABLE_CUDA)
set(BLT_ENABLE_CUDA ${ENABLE_CUDA})
endif()
if(NOT BLT_ENABLE_MPI)
set(BLT_ENABLE_MPI ${ENABLE_MPI})
endif()
if(NOT BLT_ENABLE_OPENMP)
set(BLT_ENABLE_OPENMP ${ENABLE_OPENMP})
endif()
if(NOT BLT_ENABLE_FIND_MPI)
set(BLT_ENABLE_FIND_MPI ${ENABLE_FIND_MPI})
endif()
if(NOT BLT_ENABLE_CLANG_CUDA)
set(BLT_ENABLE_CLANG_CUDA ${ENABLE_CLANG_CUDA})
endif()

set(_current_project_name ${PROJECT_NAME})
endif()

# Detect if Fortran has been introduced.
get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
if(_languages MATCHES "Fortran")
set(_fortran_already_enabled TRUE)
set(_fortran_already_enabled TRUE)
else()
set(_fortran_already_enabled FALSE)
set(_fortran_already_enabled FALSE)
endif()

# Only update ENABLE_FORTRAN if it is a new requirement, don't turn
Expand Down

0 comments on commit e9c33bc

Please sign in to comment.