summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake
blob: d89f19b8f83fe6adce04fb9413e2eb22bf32cae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>
)