diff --git a/CMakeLists.txt b/CMakeLists.txt index bdb33b0bfa..e6ab2ece88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,13 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # target_compile_options(sphinxsys_core INTERFACE $<$:-Wpedantic>) # For strict C++ standard compliance # TODO: endif() +if(SPHINXSYS_USE_SYCL) + if(NOT SPHINXSYS_USE_FLOAT) + set(SPHINXSYS_USE_FLOAT ON) + message("-- Float is used as required by SPHinXsysSYCL.") + endif() +endif() + target_compile_definitions(sphinxsys_core INTERFACE SPHINXSYS_USE_SYCL=$) target_compile_definitions(sphinxsys_core INTERFACE SPHINXSYS_USE_FLOAT=$) @@ -106,11 +113,6 @@ if(SPHINXSYS_USE_SYCL) message(FATAL_ERROR "-- SPHinXsysSYCL is only supported with IntelLLVM compiler.") endif() - if(NOT SPHINXSYS_USE_FLOAT) - set(SPHINXSYS_USE_FLOAT ON) - message("-- Float is used as required by SPHinXsysSYCL.") - endif() - if(NOT SPHINXSYS_SYCL_TARGETS) set(SPHINXSYS_SYCL_TARGETS spir64_x86_64) endif()