diff options
Diffstat (limited to 'Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake')
-rw-r--r-- | Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake new file mode 100644 index 0000000..d89f19b --- /dev/null +++ b/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake @@ -0,0 +1,19 @@ +enable_language(CSharp) +if(NOT CMAKE_CSharp_COMPILER) + return() +endif() + +set(CMAKE_DOTNET_SDK "Microsoft.NET.Sdk") +set(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "net5.0") + +add_executable(foo csharponly.cs lib1.cs) + +# Issue 23376 +target_compile_definitions( + foo + PUBLIC + MY_FOO_DEFINE + "MY_BAR_ASSIGNMENT=bar" + $<$<CONFIG:Debug>:DEFINE_ONLY_FOR_DEBUG> + $<$<CONFIG:Release>:DEFINE_ONLY_FOR_RELEASE> +) |