-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
58 lines (51 loc) · 1.25 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 OLD)
project(vcrtl CXX ASM_MASM)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/build)
find_package(WDK REQUIRED)
list(REMOVE_ITEM WDK_COMPILE_FLAGS /kernel)
wdk_add_library(vcrtl_driver STATIC
src/algorithm.h
src/assert.cpp
src/assert.h
src/bugcheck.h
src/flags.h
src/intrin.h
src/limits.h
src/memcpy.h
src/ptr_to_member.h
src/runtime.cpp
src/rva.h
src/stddef.h
src/stdint.h
src/type_info.cpp
src/type_info.h
src/type_traits.h
src/utils.h
src/win32_seh.h
)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
target_sources(vcrtl_driver PUBLIC
src/x64/capture.asm
src/x64/cpu_context.h
src/x64/eh_structs_x64.h
src/x64/fh3.cpp
src/x64/fh4.cpp
src/x64/throw.cpp
src/x64/throw.h
src/x64/unwind_handler.cpp
)
else()
target_sources(vcrtl_driver PUBLIC
src/x86/eh_helpers.asm
src/x86/eh_structs_x86.h
src/x86/fh3_x86.asm
src/x86/memcpy.asm
src/x86/nlg.asm
src/x86/throw_x86.cpp
)
list(APPEND CMAKE_ASM_MASM_FLAGS "/safeseh")
endif()
target_compile_features(vcrtl_driver PUBLIC cxx_std_17)
wdk_add_driver(vcrtl_driver_test test/test.cpp)
target_link_libraries(vcrtl_driver_test vcrtl_driver)