mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-16 12:11:04 -06:00
UseSWIG: Use CSharp language only if it is enabled
In commit v3.12.0-rc1~2^2 (UseSWIG: Add CSHARP variant for wrapper files, 2018-06-08) we explicitly marked swig-generated `.cs` files as `LANGUAGE` CSharp so that the resulting sources can be compiled. However, this works only when the CSharp language has been enabled. Fixes: #18184
This commit is contained in:
@@ -294,7 +294,7 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
|
||||
endif()
|
||||
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS})
|
||||
set(extra_file "${generatedpath}/${module_basename}${it}")
|
||||
if (extra_file MATCHES "\\.cs$")
|
||||
if (extra_file MATCHES "\\.cs$" AND CMAKE_CSharp_COMPILER_LOADED)
|
||||
set_source_files_properties(${extra_file} PROPERTIES LANGUAGE "CSharp")
|
||||
else()
|
||||
# Treat extra outputs as plain files regardless of language.
|
||||
|
||||
Reference in New Issue
Block a user