e3a2725d6b031cc44439edaed022ad519b53724a
[reactos.git] / modules / rostests / apitests / ntdll / CMakeLists.txt
1
2 add_subdirectory(load_notifications)
3
4 include_directories($<TARGET_FILE_DIR:load_notifications>)
5 spec2def(ntdll_apitest.exe ntdll_apitest.spec)
6
7 list(APPEND SOURCE
8 LdrEnumResources.c
9 load_notifications.c
10 NtAcceptConnectPort.c
11 NtAllocateVirtualMemory.c
12 NtApphelpCacheControl.c
13 NtContinue.c
14 NtCreateFile.c
15 NtCreateKey.c
16 NtCreateThread.c
17 NtDeleteKey.c
18 NtDuplicateObject.c
19 NtFreeVirtualMemory.c
20 NtLoadUnloadKey.c
21 NtMapViewOfSection.c
22 NtMutant.c
23 NtOpenKey.c
24 NtOpenProcessToken.c
25 NtOpenThreadToken.c
26 NtProtectVirtualMemory.c
27 NtQueryInformationFile.c
28 NtQueryInformationProcess.c
29 NtQueryKey.c
30 NtQuerySystemEnvironmentValue.c
31 NtQuerySystemInformation.c
32 NtQueryVolumeInformationFile.c
33 NtReadFile.c
34 NtSaveKey.c
35 NtSetInformationFile.c
36 NtSetValueKey.c
37 NtSetVolumeInformationFile.c
38 NtWriteFile.c
39 RtlAllocateHeap.c
40 RtlBitmap.c
41 RtlCopyMappedMemory.c
42 RtlDeleteAce.c
43 RtlDetermineDosPathNameType.c
44 RtlDoesFileExists.c
45 RtlDosApplyFileIsolationRedirection_Ustr.c
46 RtlDosPathNameToNtPathName_U.c
47 RtlDosSearchPath_U.c
48 RtlDosSearchPath_Ustr.c
49 RtlFirstFreeAce.c
50 RtlGenerate8dot3Name.c
51 RtlGetFullPathName_U.c
52 RtlGetFullPathName_Ustr.c
53 RtlGetFullPathName_UstrEx.c
54 RtlGetLengthWithoutTrailingPathSeperators.c
55 RtlGetLongestNtPathLength.c
56 RtlHandle.c
57 RtlImageRvaToVa.c
58 RtlInitializeBitMap.c
59 RtlIsNameLegalDOS8Dot3.c
60 RtlMemoryStream.c
61 RtlNtPathNameToDosPathName.c
62 RtlpEnsureBufferSize.c
63 RtlQueryTimeZoneInfo.c
64 RtlReAllocateHeap.c
65 RtlUnicodeStringToAnsiString.c
66 RtlUpcaseUnicodeStringToCountedOemString.c
67 StackOverflow.c
68 SystemInfo.c
69 Timer.c
70 precomp.h)
71
72 if(ARCH STREQUAL "i386")
73 add_asm_files(ntdll_apitest_asm i386/NtContinue.S)
74 endif()
75
76 add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/load_notifications/load_notifications.dll)
77 add_executable(ntdll_apitest
78 ${SOURCE}
79 ${ntdll_apitest_asm}
80 testdata.rc
81 ${CMAKE_CURRENT_BINARY_DIR}/ntdll_apitest.def
82 testlist.c)
83 target_link_libraries(ntdll_apitest wine uuid ${PSEH_LIB})
84 set_module_type(ntdll_apitest win32cui)
85 add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll)
86 add_pch(ntdll_apitest precomp.h SOURCE)
87
88 if(NOT MSVC)
89 set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format")
90
91 # Avoid "universal character names are only valid in C++ and C99" error.
92 set_property(TARGET ntdll_apitest PROPERTY C_STANDARD 99)
93 endif()
94
95 add_rostests_file(TARGET ntdll_apitest)
96 add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
97 # These are empty files
98 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
99 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
100 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
101 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
102 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
103
104 # Convenience target for running from IDE
105 if(MSVC_IDE)
106 set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
107 add_custom_command(TARGET ntdll_apitest
108 POST_BUILD
109 COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
110 COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
111 COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
112 COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
113 COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
114 COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
115 COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
116 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
117 endif()