[SHELL-EXPERIMENTS]
[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 SHARED
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_drv_common
44 mesa_swrast
45 mesa_swrast_setup
46 mesa_tnl
47 mesa_main
48 mesa_vbo
49 mesa_math
50 )
51
52 if((ARCH STREQUAL "i386") AND (NOT MSVC))
53 target_link_libraries(opengl32 mesa_x86)
54 endif()
55
56 if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
57 target_link_libraries(opengl32 mingwex)
58 endif()
59
60 set_module_type(opengl32 win32dll HOTPATCHABLE)
61
62 add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
63 add_pch(opengl32 opengl32.h SOURCE)
64 add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)