# Copyright (c) 2022 Dominic Masters
# 
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

# Include tools
add_subdirectory(dawntools)

# Change what we are building
add_subdirectory(${DAWN_BUILDING})

# Check the game project includes the target name
if(NOT DEFINED DAWN_TARGET_NAME)
  message(FATAL_ERROR "You need to define a DAWN_TARGET_NAME")
endif()

# Add in base library
add_subdirectory(dawn)

# Compile entry targets
if(DAWN_TARGET_WIN32)
  add_subdirectory(dawnwin32)
elseif(DAWN_TARGET_LINUX64)
  add_subdirectory(dawnlinux64)
else()
  message(FATAL_ERROR "You need to define an entry target")
endif()

# Host Libraries
target_link_libraries(${DAWN_TARGET_NAME}
  PUBLIC
    ${DAWN_BUILD_HOST_LIBS}
)

# Compile support targets
if(DAWN_TARGET_GLFW)
  add_subdirectory(dawnglfw)
  add_subdirectory(dawnopengl)
endif()