summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
diff options
context:
space:
mode:
authorShannon Booth <shannon.ml.booth@gmail.com>2020-12-23 18:16:34 (GMT)
committerShannon Booth <shannon.ml.booth@gmail.com>2021-01-05 22:51:39 (GMT)
commita742b5d137d0855430a044dc4237de5aabfb08b4 (patch)
treec99ce00905019f35d142bab20816c87dd8c0cb2f /Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
parentce8bb12f72766e45ad96d98d9e1d259815dc126a (diff)
downloadCMake-a742b5d137d0855430a044dc4237de5aabfb08b4.zip
CMake-a742b5d137d0855430a044dc4237de5aabfb08b4.tar.gz
CMake-a742b5d137d0855430a044dc4237de5aabfb08b4.tar.bz2
CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target
The new target property `EXPORT_COMPILE_COMMANDS` associated with the existing global variable can be used to optionally configure targets for their compile commands to be exported. Fixes: #19462
Diffstat (limited to 'Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake')
-rw-r--r--Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
new file mode 100644
index 0000000..46c8845
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+
+add_library(Unset STATIC empty.c)
+add_library(ToBeSet STATIC expected_file.c)
+
+# Only one target with EXPORT_COMPILE_COMMANDS property.
+set_property(TARGET ToBeSet PROPERTY EXPORT_COMPILE_COMMANDS TRUE)