1
2foreach(num RANGE 1 9)
3   list(APPEND SOURCE seh000${num}.c)
4   set_source_files_properties(seh000${num}.c PROPERTIES COMPILE_DEFINITIONS
5       "main=seh000${num};test=test_${num};Echo=Echo_${num};dojump=dojump_${num};AccessViolation=AccessViolation_${num};rtlRaiseExceptin=rtlRaiseExceptin_${num};rtlRaiseException=rtlRaiseException_${num};rtlRaiseStatus=rtlRaiseStatus_${num}")
6endforeach()
7
8foreach(num RANGE 10 58)
9   list(APPEND SOURCE seh00${num}.c)
10   set_source_files_properties(seh00${num}.c PROPERTIES COMPILE_DEFINITIONS
11       "main=seh00${num};test=test_${num};Echo=Echo_${num};dojump=dojump_${num};AccessViolation=AccessViolation_${num};rtlRaiseExceptin=rtlRaiseExceptin_${num};rtlRaiseException=rtlRaiseException_${num};rtlRaiseStatus=rtlRaiseStatus_${num}")
12endforeach()
13
14add_library(ms_seh_test ${SOURCE})
15target_link_libraries(ms_seh_test pseh)
16add_dependencies(ms_seh_test psdk)
17
18if(MSVC)
19    # error C4189: 'Index2': local variable is initialized but not referenced
20    # warning C4197: 'volatile LONG': top-level volatile in cast is ignored
21    # warning C4532: 'break': jump out of __finally block has undefined behavior during termination handling
22    remove_target_compile_option(ms_seh_test "/we4189")
23    target_compile_options(ms_seh_test PRIVATE /wd4189 /wd4197 /wd4532)
24else()
25    target_compile_options(ms_seh_test
26        PRIVATE -Wno-format -Wno-implicit-function-declaration -Wno-unused-label -Wno-unused-variable)
27endif()
28