xref: /reactos/dll/keyboard/CMakeLists.txt (revision 019f21ee)
1
2list(APPEND _keyboard_layouts
3    kbda1
4    kbda2
5    kbda3
6    kbdal
7    kbdarme
8    kbdarmw
9    kbdaze
10    kbdazel
11    kbdbe
12    kbdbga
13    kbdbgm
14    kbdbgt
15    kbdblr
16    kbdbr
17    kbdbur
18    kbdcan
19    kbdcr
20    kbdcz
21    kbdcz1
22    kbdda
23    kbddv
24    kbdeo
25    kbdes
26    kbdest
27    kbdfc
28    kbdfi
29    kbdfr
30    kbdgeo
31    kbdgerg
32    kbdgneo
33    kbdgr
34    kbdgrist
35    kbdhe
36    kbdheb
37    kbdhu
38    kbdic
39    kbdinasa
40    kbdinben
41    kbdindev
42    kbdinguj
43    kbdinmal
44    kbdir
45    kbdit
46    kbdja
47    kbdkaz
48    kbdko
49    kbdla
50    kbdlt1
51    kbdlv
52    kbdmac
53    kbdne
54    kbdno
55    kbdpl
56    kbdpl1
57    kbdpo
58    kbdro
59    kbdrost
60    kbdru
61    kbdru1
62    kbdsg
63    kbdsk
64    kbdsk1
65    kbdsw
66    kbdtat
67    kbdth0
68    kbdth1
69    kbdth2
70    kbdth3
71    kbdtuf
72    kbdtuq
73    kbduk
74    kbdur
75    kbdurs
76    kbdus
77    kbdusa
78    kbdusl
79    kbdusr
80    kbdusx
81    kbduzb
82    kbdvntc
83    kbdycc
84    kbdycl)
85
86foreach(_keyboard_layout ${_keyboard_layouts})
87    spec2def(${_keyboard_layout}.dll ${_keyboard_layout}/${_keyboard_layout}.spec)
88
89    add_library(${_keyboard_layout} MODULE
90        ${_keyboard_layout}/${_keyboard_layout}.c
91        ${_keyboard_layout}/${_keyboard_layout}.rc
92        ${CMAKE_CURRENT_BINARY_DIR}/${_keyboard_layout}.def)
93
94    target_include_directories(${_keyboard_layout} PRIVATE ${REACTOS_SOURCE_DIR}/ntoskrnl/include)
95    set_entrypoint(${_keyboard_layout} 0)
96    set_image_base(${_keyboard_layout} 0x5FFF0000)
97    set_subsystem(${_keyboard_layout} native)
98
99    if(MSVC)
100        # Merge the .text and .rdata section into the .data section
101        add_target_link_flags(${_keyboard_layout} "/ignore:4254 /SECTION:.data,ER /MERGE:.text=.data /MERGE:.rdata=.data /MERGE:.bss=.data /MERGE:.edata=.data")
102    else()
103        # Use a custom linker script
104        add_target_link_flags(${_keyboard_layout} "-Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/kbdlayout.lds")
105
106        # Avoid "universal character names are only valid in C++ and C99" error.
107        set_property(TARGET ${_keyboard_layout} PROPERTY C_STANDARD 99)
108    endif()
109
110    # dynamic analysis switches
111    if (STACK_PROTECTOR)
112        target_link_libraries(${_keyboard_layout} gcc_ssp)
113    endif()
114
115    if(RUNTIME_CHECKS)
116        target_link_libraries(${_keyboard_layout} runtmchk)
117    endif()
118
119    add_dependencies(${_keyboard_layout} psdk)
120    add_cd_file(TARGET ${_keyboard_layout} DESTINATION reactos/system32 FOR all)
121endforeach()
122