<commit_before>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wold-style-cast -Winit-self -pedantic -std=c++0x -fvisibility=hidden")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion")
endif()

# If targeting GLES, save it into configuration header
if(TARGET_GLES)
    set(MAGNUM_TARGET_GLES 1)
endif()
if(TARGET_GLES2)
    set(MAGNUM_TARGET_GLES2 1)
endif()

if(GCC46_COMPATIBILITY)
    set(MAGNUM_GCC46_COMPATIBILITY 1)
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake
               ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CORRADE_INCLUDE_DIR})

# Files shared between main library and unit test library
set(Magnum_SRCS
    AbstractImage.cpp
    AbstractTexture.cpp
    AbstractShaderProgram.cpp
    Buffer.cpp
    BufferedImage.cpp
    Context.cpp
    Framebuffer.cpp
    Image.cpp
    IndexedMesh.cpp
    Mesh.cpp
    Profiler.cpp
    Query.cpp
    Renderbuffer.cpp
    Shader.cpp
    SizeTraits.cpp
    Timeline.cpp
    TypeTraits.cpp

    Implementation/BufferState.cpp
    Implementation/State.cpp

    Trade/AbstractImporter.cpp
    Trade/MeshData2D.cpp
    Trade/MeshData3D.cpp)

# Desktop-only code
if(NOT TARGET_GLES)
    set(Magnum_SRCS ${Magnum_SRCS}
        BufferedTexture.cpp)
endif()

set(Magnum_HEADERS
    AbstractImage.h
    AbstractShaderProgram.h
    AbstractTexture.h
    BufferedImage.h
    Buffer.h
    Color.h
    Context.h
    CubeMapTexture.h
    DimensionTraits.h
    Extensions.h
    Framebuffer.h
    Image.h
    ImageWrapper.h
    IndexedMesh.h
    Magnum.h
    Mesh.h
    Profiler.h
    Query.h
    Renderbuffer.h
    ResourceManager.h
    Shader.h
    SizeTraits.h
    Swizzle.h
    Texture.h
    Timeline.h
    TypeTraits.h

    magnumCompatibility.h
    magnumVisibility.h)

# Desktop-only headers
if(NOT TARGET_GLES)
    set(Magnum_HEADERS ${Magnum_HEADERS}
        BufferedTexture.h
        CubeMapTextureArray.h)
endif()

add_library(MagnumObjects OBJECT ${Magnum_SRCS})

# Files shared between main library and math unit test library
set(MagnumMath_SRCS
    Math/Math.cpp)
add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS})

# Set shared library flags for the objects, as they will be part of shared lib
# TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well
set_target_properties(MagnumObjects MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")

# Main library
add_library(Magnum SHARED
    $<TARGET_OBJECTS:MagnumObjects>
    $<TARGET_OBJECTS:MagnumMathObjects>)
set(Magnum_LIBS
    ${CORRADE_UTILITY_LIBRARY}
    ${CORRADE_PLUGINMANAGER_LIBRARY})
if(NOT TARGET_GLES)
    set(Magnum_LIBS ${Magnum_LIBS}<commit_msg>Don't compile and install unsupported functionality if targetting ES 2.0.<commit_after>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wold-style-cast -Winit-self -pedantic -std=c++0x -fvisibility=hidden")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion")
endif()

# If targeting GLES, save it into configuration header
if(TARGET_GLES)
    set(MAGNUM_TARGET_GLES 1)
endif()
if(TARGET_GLES2)
    set(MAGNUM_TARGET_GLES2 1)
endif()

if(GCC46_COMPATIBILITY)
    set(MAGNUM_GCC46_COMPATIBILITY 1)
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake
               ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CORRADE_INCLUDE_DIR})

# Files shared between main library and unit test library
set(Magnum_SRCS
    AbstractImage.cpp
    AbstractTexture.cpp
    AbstractShaderProgram.cpp
    Buffer.cpp
    Context.cpp
    Framebuffer.cpp
    Image.cpp
    IndexedMesh.cpp
    Mesh.cpp
    Profiler.cpp
    Query.cpp
    Renderbuffer.cpp
    Shader.cpp
    SizeTraits.cpp
    Timeline.cpp
    TypeTraits.cpp

    Implementation/BufferState.cpp
    Implementation/State.cpp

    Trade/AbstractImporter.cpp
    Trade/MeshData2D.cpp
    Trade/MeshData3D.cpp)

# Desktop-only code
if(NOT TARGET_GLES)
    set(Magnum_SRCS ${Magnum_SRCS}
        BufferedTexture.cpp)
endif()

# Not-ES2 code
if(NOT TARGET_GLES2)
    set(Magnum_SRCS ${Magnum_SRCS}
        BufferedImage.cpp)
endif()

set(Magnum_HEADERS
    AbstractImage.h
    AbstractShaderProgram.h
    AbstractTexture.h
    Buffer.h
    Color.h
    Context.h
    CubeMapTexture.h
    DimensionTraits.h
    Extensions.h
    Framebuffer.h
    Image.h
    ImageWrapper.h
    IndexedMesh.h
    Magnum.h
    Mesh.h
    Profiler.h
    Query.h
    Renderbuffer.h
    ResourceManager.h
    Shader.h
    SizeTraits.h
    Swizzle.h
    Texture.h
    Timeline.h
    TypeTraits.h

    magnumCompatibility.h
    magnumVisibility.h)

# Desktop-only headers
if(NOT TARGET_GLES)
    set(Magnum_HEADERS ${Magnum_HEADERS}
        BufferedTexture.h
        CubeMapTextureArray.h)
endif()

# Not-ES2 headers
if(NOT TARGET_GLES2)
    set(Magnum_HEADERS ${Magnum_HEADERS}
        BufferedImage.h)
endif()

add_library(MagnumObjects OBJECT ${Magnum_SRCS})

# Files shared between main library and math unit test library
set(MagnumMath_SRCS
    Math/Math.cpp)
add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS})

# Set shared library flags for the objects, as they will be part of shared lib
# TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well
set_target_properties(MagnumObjects MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")

# Main library
add_library(Magnum SHARED
    $<TARGET_OBJECTS:MagnumObjects>
    $<TARGET_OBJECTS:MagnumMathObjects>)
set(Magnum_LIBS
    ${CORRADE_UTILITY_LIBRARY}
    ${CORRADE_PLUGINMANAGER_LIBRARY})
if(NOT TARGET_GLES)
    set(Magnum_LIBS ${Magnum_LIBS}
{'fraction_non_alphanumeric': 0.08101654443117857, 'fraction_numerical': 0.005116834385127068, 'mean_word_length': 3.9194630872483223, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7014144', 'n_tokens_mistral': 2161, 'n_tokens_neox': 2076, 'n_words': 386}