xref: /reactos/sdk/lib/pseh/CMakeLists.txt (revision 111e4003)
1
2if(ARCH STREQUAL "i386")
3    list(APPEND ASM_SOURCE
4        i386/seh.s
5        i386/seh_prolog.s)
6elseif(ARCH STREQUAL "amd64")
7    list(APPEND ASM_SOURCE
8        amd64/seh.s
9        amd64/seh_prolog.s)
10elseif(ARCH STREQUAL "arm")
11    list(APPEND ASM_SOURCE
12        arm/seh_prolog.s)
13endif()
14
15if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND ARCH STREQUAL "amd64"))
16
17    list(APPEND SOURCE dummy.c)
18    add_asm_files(pseh_asm ${ASM_SOURCE})
19    add_library(pseh ${SOURCE} ${pseh_asm})
20    add_dependencies(pseh asm)
21
22else()
23
24    if(USE_PSEH3)
25        include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/pseh)
26        list(APPEND SOURCE
27            i386/pseh3.c
28            i386/pseh3_i386.S)
29    elseif(USE_DUMMY_PSEH)
30        list(APPEND SOURCE dummy.c)
31    elseif(ARCH STREQUAL "i386")
32        list(APPEND SOURCE
33            i386/framebased.S
34            i386/framebased-gcchack.c
35            i386/framebased-gcchack-asm.S)
36    elseif(ARCH STREQUAL "amd64")
37        list(APPEND SOURCE amd64/framebased.S)
38    elseif(ARCH STREQUAL "powerpc")
39        list(APPEND SOURCE powerpc/framebased.S)
40    endif()
41
42    add_library(pseh ${SOURCE} ${ASM_SOURCE})
43    target_link_libraries(pseh chkstk)
44    add_dependencies(pseh psdk)
45
46endif()
47