[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905
[reactos.git] / dll / win32 / jscript / CMakeLists.txt
1
2 add_definitions(
3 -D__WINESRC__
4 -D__ROS_LONG64__
5 -D_USE_MATH_DEFINES)
6
7 include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
8 spec2def(jscript.dll jscript.spec)
9
10 list(APPEND SOURCE
11 activex.c
12 array.c
13 bool.c
14 compile.c
15 date.c
16 decode.c
17 dispex.c
18 engine.c
19 enumerator.c
20 error.c
21 function.c
22 global.c
23 jscript.c
24 jscript_main.c
25 json.c
26 jsregexp.c
27 jsstr.c
28 jsutils.c
29 lex.c
30 math.c
31 number.c
32 object.c
33 regexp.c
34 string.c
35 vbarray.c)
36
37 list(APPEND PCH_SKIP_SOURCE
38 cc_parser.tab.c
39 parser.tab.c)
40
41 # cc_parser.tab.c/parser.tab.c have been generated with relative file paths...
42 set_source_files_properties(cc_parser.tab.c parser.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"")
43
44 list(APPEND jscript_rc_deps
45 ${CMAKE_CURRENT_SOURCE_DIR}/jscript.rgs
46 ${CMAKE_CURRENT_SOURCE_DIR}/jscript_classes.rgs
47 ${CMAKE_CURRENT_SOURCE_DIR}/jsglobal.rgs
48 ${CMAKE_CURRENT_BINARY_DIR}/jsglobal.tlb)
49
50 set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS "${jscript_rc_deps}")
51
52 add_library(jscript MODULE
53 ${SOURCE}
54 ${PCH_SKIP_SOURCE}
55 rsrc.rc
56 ${CMAKE_CURRENT_BINARY_DIR}/jscript.def)
57
58 add_idl_headers(jscript_idlheader jscript_classes.idl)
59 add_typelib(jsglobal.idl)
60 add_dependencies(jscript jscript_idlheader stdole2)
61 set_module_type(jscript win32dll)
62 target_link_libraries(jscript uuid wine)
63 add_importlibs(jscript user32 ole32 oleaut32 advapi32 msvcrt kernel32 ntdll)
64 add_pch(jscript precomp.h "${PCH_SKIP_SOURCE}")
65 add_cd_file(TARGET jscript DESTINATION reactos/system32 FOR all)