summaryrefslogtreecommitdiffstats
path: root/Tests/VSManagedCustomCommand
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-12-02 22:41:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-12-02 23:06:39 (GMT)
commit13a7ae2194d44f955712d65fecf0b741049da00e (patch)
tree6dc6cd3a86339ee588aab1860f9a165bd5f319a0 /Tests/VSManagedCustomCommand
parenteeaf1e10cb5f736692136cb31c4ffbb717599917 (diff)
downloadCMake-13a7ae2194d44f955712d65fecf0b741049da00e.zip
CMake-13a7ae2194d44f955712d65fecf0b741049da00e.tar.gz
CMake-13a7ae2194d44f955712d65fecf0b741049da00e.tar.bz2
VS: Revert "Add missing label in C# project-build events"
Revert commit b284a21fee (VS: Add missing label in C# project-build events, 2021-09-03, v3.22.0-rc1~156^2). The change broke cases using multiple successful custom commands. Revert it pending further investigation into the interaction of the generated script code with `Microsoft.Common.CurrentVersion.targets`, and whether this is needed for all managed projects or just C# projects. Also add a test covering the case that was broken. Fixes: #22964 Issue: #21440
Diffstat (limited to 'Tests/VSManagedCustomCommand')
-rw-r--r--Tests/VSManagedCustomCommand/CMakeLists.txt15
-rw-r--r--Tests/VSManagedCustomCommand/example.txt4
2 files changed, 19 insertions, 0 deletions
diff --git a/Tests/VSManagedCustomCommand/CMakeLists.txt b/Tests/VSManagedCustomCommand/CMakeLists.txt
new file mode 100644
index 0000000..2228875
--- /dev/null
+++ b/Tests/VSManagedCustomCommand/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.20)
+project(VSManagedCustomCommand CXX)
+
+add_custom_command(OUTPUT middle.txt
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example.txt ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/example.txt
+ )
+
+add_custom_command(OUTPUT example.cxx
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/middle.txt ${CMAKE_CURRENT_BINARY_DIR}/example.cxx
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/middle.txt
+ )
+
+add_library(example SHARED example.cxx)
+set_property(TARGET example PROPERTY COMMON_LANGUAGE_RUNTIME "")
diff --git a/Tests/VSManagedCustomCommand/example.txt b/Tests/VSManagedCustomCommand/example.txt
new file mode 100644
index 0000000..05f95f1
--- /dev/null
+++ b/Tests/VSManagedCustomCommand/example.txt
@@ -0,0 +1,4 @@
+__declspec(dllexport) int example()
+{
+ return 0;
+}