From 97b228e0a7120c31a3eaaef6c5b3aaf4fc53c9d0 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Wed, 22 Mar 2023 19:29:20 -0700 Subject: [PATCH] Fixed compilation win32 --- cmake/targets/target-tools/CMakeLists.txt | 3 ++- src/CMakeLists.txt | 7 ++++++- .../components/physics/3d/CapsuleCollider.cpp | 2 +- .../scene/components/physics/3d/CubeCollider.cpp | 2 +- src/dawnrose/CMakeLists.txt | 4 +++- src/dawntools/prefabtool/CMakeLists.txt | 15 ++++++++++----- src/dawntools/prefabtool/PrefabTool.cpp | 2 -- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/cmake/targets/target-tools/CMakeLists.txt b/cmake/targets/target-tools/CMakeLists.txt index 81cf5907..d6d50896 100644 --- a/cmake/targets/target-tools/CMakeLists.txt +++ b/cmake/targets/target-tools/CMakeLists.txt @@ -3,4 +3,5 @@ # This software is released under the MIT License. # https://opensource.org/licenses/MIT -set(DAWN_BUILDING dawntools CACHE INTERNAL ${DAWN_CACHE_TARGET}) \ No newline at end of file +# set(DAWN_BUILDING dawntools CACHE INTERNAL ${DAWN_CACHE_TARGET}) +set(DAWN_BUILD_TOOLS true CACHE INTERNAL ${DAWN_CACHE_TARGET}) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ac9757e..aae12bb6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,8 +12,13 @@ set( # Include shared libs add_subdirectory(dawnshared) +# Include tools +add_subdirectory(dawntools) + # Change what we are building. Pulled from the cmake/targets dir. -add_subdirectory(${DAWN_BUILDING}) +if(DEFINED DAWN_BUILDING) + add_subdirectory(${DAWN_BUILDING}) +endif() # Validate game project includes the target name if(DEFINED DAWN_TARGET_NAME) diff --git a/src/dawn/scene/components/physics/3d/CapsuleCollider.cpp b/src/dawn/scene/components/physics/3d/CapsuleCollider.cpp index a488481e..0e224e02 100644 --- a/src/dawn/scene/components/physics/3d/CapsuleCollider.cpp +++ b/src/dawn/scene/components/physics/3d/CapsuleCollider.cpp @@ -19,7 +19,7 @@ bool_t CapsuleCollider::performRaycast( return raytestCapsule( ray, - (struct PhysicsCapsule){ + { .height = this->height, .radius = this->radius, .origin = this->transform->getWorldPosition() diff --git a/src/dawn/scene/components/physics/3d/CubeCollider.cpp b/src/dawn/scene/components/physics/3d/CubeCollider.cpp index c0b789fa..444277f2 100644 --- a/src/dawn/scene/components/physics/3d/CubeCollider.cpp +++ b/src/dawn/scene/components/physics/3d/CubeCollider.cpp @@ -19,7 +19,7 @@ bool_t CubeCollider::performRaycast( return Dawn::raytestCube( ray, - (struct AABB3D){ .min = this->min, .max = this->max }, + { .min = this->min, .max = this->max }, this->transform->getWorldTransform(), &result->point, &result->normal, diff --git a/src/dawnrose/CMakeLists.txt b/src/dawnrose/CMakeLists.txt index e8839bc6..41c7387b 100644 --- a/src/dawnrose/CMakeLists.txt +++ b/src/dawnrose/CMakeLists.txt @@ -15,4 +15,6 @@ target_include_directories(${DAWN_TARGET_NAME} # Subdirs add_subdirectory(game) add_subdirectory(save) -add_subdirectory(scene) \ No newline at end of file +add_subdirectory(scene) + +tool_prefab("example-prefab.xml") \ No newline at end of file diff --git a/src/dawntools/prefabtool/CMakeLists.txt b/src/dawntools/prefabtool/CMakeLists.txt index 1a08d3b9..642a4577 100644 --- a/src/dawntools/prefabtool/CMakeLists.txt +++ b/src/dawntools/prefabtool/CMakeLists.txt @@ -37,11 +37,16 @@ target_link_libraries(prefabtool ) # Tool Function -function(tool_prefab target in) - add_custom_target(${target} +function(tool_prefab in) + set(DEPS "") + if(DAWN_BUILD_TOOLS) + set(DEPS prefabtool) + endif() + + add_custom_target(prefab_${in} COMMAND prefabtool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" - COMMENT "Generating prefab ${target} from ${in}" - DEPENDS prefabtool + COMMENT "Generating prefab from ${in}" + DEPENDS ${DEPS} ) - add_dependencies(${DAWN_TARGET_NAME} ${target}) + add_dependencies(${DAWN_TARGET_NAME} prefab_${in}) endfunction() \ No newline at end of file diff --git a/src/dawntools/prefabtool/PrefabTool.cpp b/src/dawntools/prefabtool/PrefabTool.cpp index 3265f8fd..fa32555d 100644 --- a/src/dawntools/prefabtool/PrefabTool.cpp +++ b/src/dawntools/prefabtool/PrefabTool.cpp @@ -22,7 +22,5 @@ int32_t PrefabTool::start() { return 1; } - std::cout << "Input: " << input.filename << std::endl; - return 0; } \ No newline at end of file