[OPENGL32]
[reactos.git] / reactos / 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 ${CMAKE_CURRENT_BINARY_DIR}/opengl32_stubs.c
24 ${CMAKE_CURRENT_BINARY_DIR}/opengl32.def
25 )
26
27 set_source_files_properties(gcrt0.o libgmon.a PROPERTIES EXTERNAL_OBJECT TRUE)
28
29 if(ARCH STREQUAL "i386")
30 # Optimisation: use asm trampolines to ICD provided functions
31 add_asm_files(opengl32_asm
32 glapi_x86.s
33 )
34 endif()
35
36 add_library(opengl32 SHARED ${SOURCE} ${opengl32_asm})
37 target_link_libraries(opengl32
38 wine
39 ${PSEH_LIB}
40 mesa_drv_common
41 mesa_swrast
42 mesa_swrast_setup
43 mesa_tnl
44 mesa_main
45 mesa_vbo
46 mesa_math
47 )
48
49 if((ARCH STREQUAL "i386") AND (NOT MSVC))
50 target_link_libraries(opengl32 mesa_x86)
51 endif()
52
53 set_module_type(opengl32 win32dll)
54
55 add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
56 add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)