Enable GMX_GPU=SYCL compiles
[alexxy/gromacs.git] / cmake / gmxCFlags.cmake
index 5789f62e51cdfb884d4d3932e85b3873f883078b..1fffd3e7a90f2228adbf0a3d82faad8adeba7dfe 100644 (file)
@@ -60,7 +60,10 @@ ENDMACRO(GMX_TEST_CXXFLAG VARIABLE FLAGS CXXFLAGSVAR)
 # works the same way.
 function(gmx_target_compile_options_inner)
     set (CFLAGS "${SIMD_C_FLAGS};${MPI_COMPILE_FLAGS};${EXTRA_C_FLAGS};${GMXC_CFLAGS}" PARENT_SCOPE)
-    set (CXXFLAGS "${SIMD_CXX_FLAGS};${MPI_COMPILE_FLAGS};${EXTRA_CXX_FLAGS};${GMXC_CXXFLAGS}" PARENT_SCOPE)
+    # When SYCL support has been enabled (so the flag is non-empty), we still *disable* things
+    # by default to avoid running each file three passes through the compiler. Then we'll explicitly
+    # enable SYCL for the few files using it, as well as the linker.
+    set (CXXFLAGS "${SIMD_CXX_FLAGS};${MPI_COMPILE_FLAGS};${DISABLE_SYCL_CXX_FLAGS};${EXTRA_CXX_FLAGS};${GMXC_CXXFLAGS}" PARENT_SCOPE)
 endfunction()
 
 # Implementation function to add compiler flags expected for all