summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CXXModules/examples/export-compile-commands/CMakeLists.txt
blob: b9c7bb3c6723a5ef101c1304367918baf5c70983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cmake_minimum_required(VERSION 3.24...3.28)
project(cxx_modules_export_compile_commands CXX)

include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")

set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

add_executable(export-compile-commands)
target_sources(export-compile-commands
  PRIVATE
    main.cxx
  PRIVATE
    FILE_SET CXX_MODULES
      BASE_DIRS
        "${CMAKE_CURRENT_SOURCE_DIR}"
      FILES
        importable.cxx)
target_compile_features(export-compile-commands PUBLIC cxx_std_20)

add_test(NAME export-compile-commands COMMAND export-compile-commands)