diff --git a/CMakeLists.txt b/CMakeLists.txt index 81ca5ac..900b6ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ if (UNIX AND NOT APPLE) GN_API_VULKAN ) + set(VULKAN_BUILT ON) add_subdirectory(projects/apis/vulkan/) - target_link_libraries(Gryphn INTERFACE GryphnVulkanImpl) endif() if (APPLE) add_compile_definitions( @@ -22,10 +22,19 @@ if (APPLE) ) add_subdirectory(projects/apis/vulkan/) add_subdirectory(projects/apis/metal/) - target_link_libraries(Gryphn INTERFACE GryphnVulkanImpl GryphnMetalImpl) + + set(VULKAN_BUILT ON) + set(METAL_BUILT ON) endif() add_subdirectory(projects/loader) # build gryphn loader add_subdirectory(projects/core) # build gryphn core add_subdirectory(projects/platform) # build gryphn platform add_subdirectory(projects/validation_layers/function_loader/) target_link_libraries(Gryphn INTERFACE GryphnCore GryphnLoader GryphnPlatform GryphnFunctionValidator) + +if (VULKAN_BUILT) + target_link_libraries(Gryphn INTERFACE GryphnVulkanImpl) +endif() +if (METAL_BUILT) + target_link_libraries(Gryphn INTERFACE GryphnMetalImpl) +endif() diff --git a/projects/apis/vulkan/CMakeLists.txt b/projects/apis/vulkan/CMakeLists.txt index 7293961..6fd0bec 100644 --- a/projects/apis/vulkan/CMakeLists.txt +++ b/projects/apis/vulkan/CMakeLists.txt @@ -3,7 +3,7 @@ project(GryphnVulkanImpl) add_compile_definitions(GN_REVEAL_IMPL) file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS "src/*.c" "src/*.h") -file(GLOB_RECURSE LOADER_FILES CONFIGURE_DEPENDS "loader/*.c" "loader/*.h") +file(GLOB_RECURSE LOADER_FILES CONFIGURE_DEPENDS "loader/*.c") if (APPLE) file(GLOB_RECURSE METAL_FILES CONFIGURE_DEPENDS "src/*.m") endif() diff --git a/projects/core/src/instance/gryphn_instance.h b/projects/core/src/instance/gryphn_instance.h index 9fb99a9..beae858 100644 --- a/projects/core/src/instance/gryphn_instance.h +++ b/projects/core/src/instance/gryphn_instance.h @@ -1,6 +1,6 @@ #pragma once -#include "gryphn_rendering_api.h" -#include "gryphn_handles.h" +#include "core/src/gryphn_rendering_api.h" +#include "core/src/gryphn_handles.h" #include "utils/gryphn_version.h" #include "utils/gryphn_error_code.h" #include "loader/src/gryphn_loader.h" diff --git a/projects/loader/src/gryphn_loader.c b/projects/loader/src/gryphn_loader.c index 37d5987..c7a7f08 100644 --- a/projects/loader/src/gryphn_loader.c +++ b/projects/loader/src/gryphn_loader.c @@ -7,6 +7,7 @@ #include #endif +#include "stdio.h" #include "core/src/instance/gryphn_instance.h" // load the speedy API functions or something like that