mirror of
https://github.com/reactos/CMake.git
synced 2025-03-03 01:26:05 +00:00
fileapi: Add test for codemodel v2
This commit is contained in:
parent
3e922ceb5e
commit
ea0a060168
10
Tests/RunCMake/FileAPI/alias/CMakeLists.txt
Normal file
10
Tests/RunCMake/FileAPI/alias/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
project(Alias)
|
||||
enable_language(CXX)
|
||||
|
||||
add_library(c_alias_lib ALIAS c_lib)
|
||||
add_executable(c_alias_exe ../empty.c)
|
||||
target_link_libraries(c_alias_exe PRIVATE c_alias_lib)
|
||||
|
||||
add_library(cxx_alias_lib ALIAS cxx_lib)
|
||||
add_executable(cxx_alias_exe ../empty.cxx)
|
||||
target_link_libraries(cxx_alias_exe PRIVATE cxx_alias_lib)
|
@ -3,8 +3,9 @@ set(expect
|
||||
query/client-foo
|
||||
query/client-foo/query.json
|
||||
reply
|
||||
reply/codemodel-v2-[0-9a-f]+.json
|
||||
reply/index-[0-9.T-]+.json
|
||||
reply/codemodel-v2-[0-9a-f]+\\.json
|
||||
reply/index-[0-9.T-]+\\.json
|
||||
.*
|
||||
)
|
||||
check_api("^${expect}$")
|
||||
|
||||
|
@ -3,8 +3,9 @@ set(expect
|
||||
query/client-foo
|
||||
query/client-foo/codemodel-v2
|
||||
reply
|
||||
reply/codemodel-v2-[0-9a-f]+.json
|
||||
reply/index-[0-9.T-]+.json
|
||||
reply/codemodel-v2-[0-9a-f]+\\.json
|
||||
reply/index-[0-9.T-]+\\.json
|
||||
.*
|
||||
)
|
||||
check_api("^${expect}$")
|
||||
|
||||
|
@ -2,8 +2,9 @@ set(expect
|
||||
query
|
||||
query/codemodel-v2
|
||||
reply
|
||||
reply/codemodel-v2-[0-9a-f]+.json
|
||||
reply/index-[0-9.T-]+.json
|
||||
reply/codemodel-v2-[0-9a-f]+\\.json
|
||||
reply/index-[0-9.T-]+\\.json
|
||||
.*
|
||||
)
|
||||
check_api("^${expect}$")
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1,34 @@
|
||||
# FIXME: enable_language(C) and add targets to dump
|
||||
enable_language(C)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake")
|
||||
|
||||
add_library(c_lib empty.c)
|
||||
add_executable(c_exe empty.c)
|
||||
target_link_libraries(c_exe PRIVATE c_lib)
|
||||
|
||||
add_library(c_shared_lib SHARED empty.c)
|
||||
add_executable(c_shared_exe empty.c)
|
||||
target_link_libraries(c_shared_exe PRIVATE c_shared_lib)
|
||||
|
||||
add_library(c_static_lib STATIC empty.c)
|
||||
add_executable(c_static_exe empty.c)
|
||||
target_link_libraries(c_static_exe PRIVATE c_static_lib)
|
||||
|
||||
add_subdirectory(cxx)
|
||||
add_subdirectory(alias)
|
||||
add_subdirectory(object)
|
||||
add_subdirectory(imported)
|
||||
add_subdirectory(custom)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild")
|
||||
|
||||
set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
|
||||
set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib)
|
||||
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT _ipo LANGUAGES C)
|
||||
if(_ipo)
|
||||
set_property(TARGET c_shared_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
set_property(TARGET c_shared_exe PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
set_property(TARGET c_static_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/ipo_enabled.txt" "")
|
||||
endif()
|
||||
|
5
Tests/RunCMake/FileAPI/custom/CMakeLists.txt
Normal file
5
Tests/RunCMake/FileAPI/custom/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
project(Custom)
|
||||
|
||||
add_custom_target(custom_tgt COMMAND ${CMAKE_COMMAND} -E echo "Building custom_tgt")
|
||||
add_executable(custom_exe ../empty.c)
|
||||
add_dependencies(custom_exe custom_tgt)
|
15
Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
Normal file
15
Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
project(Cxx)
|
||||
enable_language(CXX)
|
||||
|
||||
add_library(cxx_lib ../empty.cxx)
|
||||
add_executable(cxx_exe ../empty.cxx)
|
||||
target_link_libraries(cxx_exe PRIVATE cxx_lib)
|
||||
set_property(TARGET cxx_exe PROPERTY FOLDER bin)
|
||||
|
||||
add_library(cxx_shared_lib SHARED ../empty.cxx)
|
||||
add_executable(cxx_shared_exe ../empty.cxx)
|
||||
target_link_libraries(cxx_shared_exe PRIVATE cxx_shared_lib)
|
||||
|
||||
add_library(cxx_static_lib STATIC ../empty.cxx)
|
||||
add_executable(cxx_static_exe ../empty.cxx)
|
||||
target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib)
|
0
Tests/RunCMake/FileAPI/empty.c
Normal file
0
Tests/RunCMake/FileAPI/empty.c
Normal file
0
Tests/RunCMake/FileAPI/empty.cxx
Normal file
0
Tests/RunCMake/FileAPI/empty.cxx
Normal file
24
Tests/RunCMake/FileAPI/imported/CMakeLists.txt
Normal file
24
Tests/RunCMake/FileAPI/imported/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
||||
project(Imported)
|
||||
|
||||
add_library(imported_lib UNKNOWN IMPORTED)
|
||||
add_executable(imported_exe IMPORTED)
|
||||
add_executable(link_imported_exe ../empty.c)
|
||||
target_link_libraries(link_imported_exe PRIVATE imported_lib)
|
||||
|
||||
add_library(imported_shared_lib SHARED IMPORTED)
|
||||
add_executable(link_imported_shared_exe ../empty.c)
|
||||
target_link_libraries(link_imported_shared_exe PRIVATE imported_shared_lib)
|
||||
|
||||
add_library(imported_static_lib STATIC IMPORTED)
|
||||
add_executable(link_imported_static_exe ../empty.c)
|
||||
target_link_libraries(link_imported_static_exe PRIVATE imported_static_lib)
|
||||
|
||||
if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
|
||||
add_library(imported_object_lib OBJECT IMPORTED)
|
||||
add_executable(link_imported_object_exe ../empty.c)
|
||||
target_link_libraries(link_imported_object_exe PRIVATE imported_object_lib)
|
||||
endif()
|
||||
|
||||
add_library(imported_interface_lib INTERFACE IMPORTED)
|
||||
add_executable(link_imported_interface_exe ../empty.c)
|
||||
target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib)
|
9
Tests/RunCMake/FileAPI/include_test.cmake
Normal file
9
Tests/RunCMake/FileAPI/include_test.cmake
Normal file
@ -0,0 +1,9 @@
|
||||
add_library(interface_lib INTERFACE)
|
||||
target_compile_definitions(interface_lib INTERFACE COMPILED_WITH_INTERFACE_LIB)
|
||||
add_executable(interface_exe empty.c)
|
||||
target_link_libraries(interface_exe PRIVATE inteface_lib)
|
||||
set_property(TARGET interface_exe PROPERTY ENABLE_EXPORTS ON)
|
||||
set_property(TARGET interface_exe PROPERTY RUNTIME_OUTPUT_DIRECTORY bin)
|
||||
set_property(TARGET interface_exe PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib)
|
||||
set_property(TARGET interface_exe PROPERTY OUTPUT_NAME my_interface_exe)
|
||||
set_property(TARGET interface_exe PROPERTY SUFFIX .myexe)
|
13
Tests/RunCMake/FileAPI/object/CMakeLists.txt
Normal file
13
Tests/RunCMake/FileAPI/object/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(Object)
|
||||
enable_language(CXX)
|
||||
|
||||
add_library(c_object_lib OBJECT ../empty.c)
|
||||
add_executable(c_object_exe ../empty.c)
|
||||
target_link_libraries(c_object_exe PRIVATE c_object_lib)
|
||||
|
||||
add_library(cxx_object_lib OBJECT ../empty.cxx)
|
||||
add_executable(cxx_object_exe ../empty.cxx)
|
||||
target_link_libraries(cxx_object_exe PRIVATE cxx_object_lib)
|
||||
|
||||
install(TARGETS c_object_exe cxx_object_exe DESTINATION bin)
|
12
Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
Normal file
12
Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
project(External)
|
||||
enable_language(CXX)
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" "")
|
||||
add_executable(generated_exe empty.c)
|
||||
target_sources(generated_exe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
|
||||
source_group("Generated Source Files" FILES "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
|
||||
set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" PROPERTY GENERATED ON)
|
||||
set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY)
|
||||
set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY)
|
0
Tests/RunCMake/FileAPIExternalSource/empty.c
Normal file
0
Tests/RunCMake/FileAPIExternalSource/empty.c
Normal file
Loading…
x
Reference in New Issue
Block a user