xref: /reactos/dll/opengl/opengl32/CMakeLists.txt (revision 4561998a)
1
2spec2def(opengl32.dll opengl32.spec ADD_IMPORTLIB)
3
4include_directories(../mesa)
5
6add_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
12if(OPENGL32_USE_TLS)
13    add_definitions(-DOPENGL32_USE_TLS)
14endif()
15
16list(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
28if(ARCH STREQUAL "i386")
29    # Optimisation: use asm trampolines to ICD provided functions
30    add_asm_files(opengl32_asm
31        glapi_x86.s
32    )
33endif()
34
35add_library(opengl32 SHARED
36    ${SOURCE}
37    ${opengl32_asm}
38    ${CMAKE_CURRENT_BINARY_DIR}/opengl32.def)
39
40target_link_libraries(opengl32
41    wine
42    ${PSEH_LIB}
43    mesa
44)
45
46set_module_type(opengl32 win32dll)
47add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll)
48add_pch(opengl32 opengl32.h SOURCE)
49add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all)
50