set(pengu_config_lib ${pengu_config}/lib)
set(pengu_lib_path ${PROJECT_SOURCE_DIR}/${pengu_lib})

if(NOT WIN32)
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        set(pengu_libraries stdc++fs)
    endif()

    if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
        list(APPEND pengu_flags -Xpreprocessor)
    endif()

    # optimization for loading times
    list(APPEND pengu_flags -pthread)
    list(APPEND pengu_flags -fopenmp)
endif()

list(APPEND pengu_definitions _USE_MATH_DEFINES)

# some formatted printing
set(pengu_config_msg " - Library: ")

# load dependencies via separate cmake file
include(${pengu_config_lib}/GLFW.cmake)                   # glfw-x11 / glfw-wayland					# libglfw3-dev
include(${pengu_config_lib}/Vulkan.cmake)                 # vulkan-intel / vulkan-radeon / nvidia	# libvulkan-dev
include(${pengu_config_lib}/SPIRV_Cross.cmake)            # SPIRV-Cross	                    # libspirv_cross_c_shared
include(${pengu_config_lib}/VulkanMemoryAllocator.cmake)  # VulkanMemoryAllocator

# cleanup of compiler flags
if (pengu_flags)
    list(REMOVE_DUPLICATES pengu_flags)
endif()

# cleanup of include directories from dependencies
if (pengu_includes)
    list(REMOVE_DUPLICATES pengu_includes)
endif ()

# add custom function to include a file like a shader as string
include(${pengu_config}/IncludeShader.cmake)

# cleanup of compiler definitions aka preprocessor variables
if (pengu_definitions)
    list(REMOVE_DUPLICATES pengu_definitions)
endif ()

list(JOIN pengu_flags " " pengu_flags)
