[cmake-developers] Debugging issues with enable_language(CSHARP)

Wesley Smith wesley.hoke at gmail.com
Wed Mar 22 12:33:31 EDT 2017


Hi,
I'm trying to diagnose why enable_language(CSHARP) isn't working for me in
the RC candidate. I've built CMake from source and am trying to step
through the code, but am coming up against the fact that this is an
enormous project and I don't quite know where to look.

The new C# support is something I want to use on an upcoming project, so
I'd like to help solve any issues with it

Here's where I'm at:


* I'm stepping through cmGlobalGenerator.xx in the EnableLanguage
function.  When the only language is CSHARP, I'm erroring out where it
attempts to get the definition of CMAKE_SHARP_COMPILER

* In CMakeErrr.log, I see:
The CSharp compiler identification could not be found in
"C:/Users/wes/Documents/GitHub/add-in/build_/CMakeFiles/3.8.20170317-g45851/CompilerIdCSharp/CompilerIdCSharp.csproj"

When I compile and run this project by hand, I'm seeing

InfoCompiler
"INFO:compiler[Microsoft Visual Studio]"
InfoPlatform
"INFO:platform[Windows]"
InfoArchitecture
"INFO:arch[x64]"
InfoCompilerVersion
"INFO:compiler_version[2017]"

printed from this code:

static void Main(string[] args)
        {
            // we have to print the lines to make sure
            // the compiler does not optimize them away ...
            System.Console.WriteLine(InfoCompiler);
            System.Console.WriteLine(InfoPlatform);
            System.Console.WriteLine(InfoArchitecture);
            System.Console.WriteLine(InfoCompilerVersion);
        }


It all looks good to me.  What I haven't been able to find is where the
project is compiled and run from within CMake and the console stdout read
in order to verify the C# compiler settings.


thanks,
wes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170322/9b53f5a1/attachment.html>


More information about the cmake-developers mailing list