Skip to content

Commit 52f7445

Browse files
committed
Fixup: define variables needed in the enable_languages macro with the correct scope
1 parent 06fb990 commit 52f7445

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

cmake/enable_languages.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@ include_guard(GLOBAL)
1515
include(CheckLanguage)
1616
include(CheckSourceCompiles)
1717

18-
# Define the minimum supported CUDA and HIP versions
19-
set(MINIMUM_SUPPORTED_CUDA_VERSION 12.4)
20-
set(MINIMUM_SUPPORTED_HIP_VERSION 7.0) # patch version differs from the rocm package
21-
22-
# Set the std which is used in compilation testing examples
23-
set(_flamegpu_cxx_std 20)
24-
2518
# Define a cache variable FLAMEGPU_GPU controlling the GPU API to use, defaulting to CUDA in the GUI.
2619
set(_FLAMEGPU_GPU_OPTIONS "CUDA;HIP;OFF")
27-
set(FLAMEGPU_GPU "CUDA" CACHE STRING "The GPU API to use. Choose from ${_FLAMEGPU_GPU_OPTIONS}. Use OFF for a documentation-only build." )
20+
set(FLAMEGPU_GPU "CUDA" CACHE STRING "The GPU API to use. Choose from ${_FLAMEGPU_GPU_OPTIONS}. Use OFF for a documentation-only build.")
2821
set_property(CACHE FLAMEGPU_GPU PROPERTY STRINGS ${_FLAMEGPU_GPU_OPTIONS})
2922
# Validate that FLAMEGPU_GPU is set to an allowed value
3023
if(NOT "${FLAMEGPU_GPU}" IN_LIST _FLAMEGPU_GPU_OPTIONS)
@@ -39,6 +32,13 @@ macro(flamegpu_enable_languages)
3932
message(FATAL_ERROR "flamegpu_enable_languages must be called after a call to 'project()'")
4033
endif()
4134

35+
# Define some local variables in macro-scope so they are available when required (when included by other projects, i.e. templates)
36+
# Define the minimum supported CUDA and HIP versions
37+
set(MINIMUM_SUPPORTED_CUDA_VERSION 12.4)
38+
set(MINIMUM_SUPPORTED_HIP_VERSION 7.0) # patch version differs from the rocm package
39+
# Set the std which is used in compilation testing examples
40+
set(_flamegpu_cxx_std 20)
41+
4242
# Check for Host and Device compiler support if not in an intentional documentation-only build
4343
if (NOT ${FLAMEGPU_GPU} STREQUAL "OFF")
4444
# Get the currently enabled languages, so that if a parent project has HIP enabled but FLAMEGPU is configured for CUDA we can raise an appropriate warning/error

0 commit comments

Comments
 (0)