xref: /reactos/sdk/lib/crt/except/except.cmake (revision b09b5584)
1
2if(ARCH STREQUAL "i386")
3    list(APPEND LIBCNTPR_EXCEPT_ASM_SOURCE
4        except/i386/chkstk_asm.s
5    )
6    list(APPEND CRT_EXCEPT_ASM_SOURCE
7        except/i386/__CxxFrameHandler3.s
8        except/i386/chkesp.s
9        except/i386/prolog.s
10    )
11    list(APPEND CRT_EXCEPT_SOURCE
12        except/i386/CxxHandleV8Frame.c
13    )
14    if(MSVC)
15        list(APPEND CRT_EXCEPT_ASM_SOURCE
16            except/i386/cpp.s)
17    endif()
18elseif(ARCH STREQUAL "amd64")
19    list(APPEND LIBCNTPR_EXCEPT_SOURCE
20        except/amd64/ehandler.c
21    )
22    list(APPEND LIBCNTPR_EXCEPT_ASM_SOURCE
23        except/amd64/chkstk_ms.s
24        except/amd64/seh.s
25    )
26    list(APPEND CRT_EXCEPT_ASM_SOURCE
27        except/amd64/seh.s
28    )
29    if(MSVC)
30        list(APPEND CRT_EXCEPT_ASM_SOURCE
31            except/amd64/cpp.s)
32    endif()
33elseif(ARCH STREQUAL "arm")
34    list(APPEND LIBCNTPR_EXCEPT_SOURCE
35        except/arm/ehandler.c
36    )
37    list(APPEND LIBCNTPR_EXCEPT_ASM_SOURCE
38        except/arm/__jump_unwind.s
39        except/arm/_abnormal_termination.s
40        except/arm/_except_handler2.s
41        except/arm/_except_handler3.s
42        except/arm/_global_unwind2.s
43        except/arm/_local_unwind2.s
44        except/arm/chkstk_asm.s
45    )
46    list(APPEND CRT_EXCEPT_ASM_SOURCE
47        except/arm/_abnormal_termination.s
48        except/arm/_except_handler2.s
49        except/arm/_except_handler3.s
50        except/arm/_global_unwind2.s
51        except/arm/_local_unwind2.s
52        except/arm/chkstk_asm.s
53    )
54    if(MSVC)
55        list(APPEND CRT_EXCEPT_ASM_SOURCE
56            except/arm/cpp.s)
57    endif()
58endif()
59
60list(APPEND CRT_EXCEPT_SOURCE
61    ${LIBCNTPR_EXCEPT_SOURCE}
62    except/stack.c
63)
64
65if(ARCH STREQUAL "i386")
66    list(APPEND CHKSTK_ASM_SOURCE except/i386/chkstk_asm.s)
67elseif(ARCH STREQUAL "amd64")
68    list(APPEND CHKSTK_ASM_SOURCE except/amd64/chkstk_ms.s)
69elseif(ARCH STREQUAL "arm")
70    list(APPEND CHKSTK_ASM_SOURCE except/arm/chkstk_asm.s)
71elseif(ARCH STREQUAL "arm64")
72    list(APPEND CHKSTK_ASM_SOURCE except/arm64/chkstk_asm.s)
73endif()
74
75add_asm_files(chkstk_lib_asm ${CHKSTK_ASM_SOURCE})
76add_library(chkstk ${CHKSTK_SOURCE} ${chkstk_lib_asm})
77set_target_properties(chkstk PROPERTIES LINKER_LANGUAGE "C")
78add_dependencies(chkstk asm)
79