[CMAKE] Use modules instead of shared libraries
[reactos.git] / dll / opengl / opengl32 / CMakeLists.txt
1
2 spec2def(opengl32.dll opengl32.spec ADD_IMPORTLIB)
3
4 include_directories(../mesa)
5
6 add_definitions(
7 -D_GDI32_ # prevent gl* being declared __declspec(dllimport) in MS headers
8 -DBUILD_GL32 # declare gl* as __declspec(dllexport) in Mesa headers
9 -D_GLAPI_NO_EXPORTS # prevent _glapi_* from being declared __declspec(dllimport)
10 )
11
12 if(OPENGL32_USE_TLS)
13 add_definitions(-DOPENGL32_USE_TLS)
14 endif()
15
16 list(APPEND SOURCE
17 apistubs.c
18 dllmain.c
19 icdload.c
20 swimpl.c
21 wgl.c
22 wgl_font.c
23 opengl32.h
24 ${CMAKE_CURRENT_BINARY_DIR}/opengl32_stubs.c)
25
26 # set_source_files_properties(gcrt0.o libgmon.a PROPERTIES EXTERNAL_OBJECT TRUE)
27
28 if(ARCH STREQUAL "i386")
29 # Optimisation: use asm trampolines to ICD provided functions
30 add_asm_files(opengl32_asm
31 glapi_x86.s
32 )
33 endif()
34
35 add_library(opengl32 MODULE
36 ${SOURCE}
37 ${opengl32_asm}
38 ${CMAKE_CURRENT_BINARY_DIR}/opengl32.def)
39
40 target_link_libraries(opengl32
41 wine
42 ${PSEH_LIB}
43 mesa
44 )
45
46 set_module_type(opengl32 win32dll)
47 add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
48 add_pch(opengl32 opengl32.h SOURCE)
49 add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)