# Copyright (c) 2021 Dominic Msters # # This software is released under the MIT License. # https://opensource.org/licenses/MIT # GLFW if(DAWN_TARGET_GLFW) if(${CMAKE_SYSTEM_NAME} MATCHES "Emscripten") set(DAWN_EMSCRIPTEN_FLAGS "${DAWN_EMSCRIPTEN_FLAGS} -s USE_GLFW=3" CACHE INTERNAL ${DAWN_CACHE_TARGET}) add_subdirectory(glad) else() add_subdirectory(glad) add_subdirectory(glfw) endif() endif() # SDL if(DAWN_TARGET_SDL2) add_subdirectory(glad) add_subdirectory(SDL) endif() # GLM add_subdirectory(glm) # FreeType if(${CMAKE_SYSTEM_NAME} MATCHES "Emscripten") set(DAWN_EMSCRIPTEN_FLAGS "${DAWN_EMSCRIPTEN_FLAGS} -s USE_FREETYPE=1" CACHE INTERNAL ${DAWN_CACHE_TARGET}) else() add_subdirectory(freetype) endif() # LibArchive if(DAWN_TARGET_ARCHIVE) add_subdirectory(libarchive) endif() # OpenAL if(DAWN_TARGET_OPENAL) set(LIBTYPE "STATIC") add_subdirectory(openal-soft) set(BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE) set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples" FORCE) add_subdirectory(AudioFile) endif() # Emscripten (TESTING ONLY) if(DEFINED DAWN_EMSCRIPTEN_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DAWN_EMSCRIPTEN_FLAGS}" CACHE INTERNAL ${DAWN_CACHE_TARGET}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DAWN_EMSCRIPTEN_FLAGS}" CACHE INTERNAL ${DAWN_CACHE_TARGET}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${DAWN_EMSCRIPTEN_FLAGS}" CACHE INTERNAL ${DAWN_CACHE_TARGET}) endif()