Skip to content

Commit

Permalink
Fix mistakenly overwritten builscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCurle committed Apr 6, 2024
1 parent be3c622 commit 030c0c0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 93 deletions.
104 changes: 53 additions & 51 deletions projs/shadow/shadow-engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
find_package(Vulkan REQUIRED)
#find_package(Vulkan REQUIRED)
#find_package(DirectXMath REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(imgui REQUIRED)
#find_package(glm REQUIRED)
find_package(ImGui REQUIRED)

set(CMAKE_CXX_STANDARD 20)
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

add_subdirectory(shadow-assets)
add_library(shadow-engine SHARED)
add_library(shadow::engine ALIAS shadow-engine)

FILE(GLOB_RECURSE SOURCES
core/src/**/*.cpp
shadow-assets/src/*.cpp
shadow-entity/src/*.cpp
shadow-renderer/src/*.cpp
shadow-reflection/src/*.cpp
shadow-utility/src/*.cpp
shadow-math/src/*.cpp
add_executable(shadow-engine-tests)
target_link_libraries(shadow-engine-tests
Catch2::Catch2
shadow::engine
)
list(FILTER SOURCES EXCLUDE REGEX ".*.test.cpp$")

SET(IncludeDirs
core/inc
shadow-assets/inc
shadow-entity/inc
shadow-renderer/inc
shadow-reflection/inc
shadow-utility/inc
shadow-math/inc
)


add_library(shadow-engine SHARED ${SOURCES} $<TARGET_OBJECTS:imgui>)

target_include_directories(shadow-engine
PRIVATE ${SDL2_INCLUDE_DIRS}
PUBLIC ${IncludeDirs}
${glm_SOURCE_DIR}
INTERFACE
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends)
add_subdirectory(assets)
add_subdirectory(core)
add_subdirectory(entity)
add_subdirectory(math)
add_subdirectory(platforms)
add_subdirectory(reflection)
add_subdirectory(renderer)
add_subdirectory(utility)
add_subdirectory(tests)

target_link_libraries(shadow-engine
PUBLIC Vulkan::Vulkan SDL2::SDL2 spdlog dylib imgui
PRIVATE -static-libgcc -static-libstdc++
PUBLIC
DirectXMath
SDL2::SDL2
glm::glm
spdlog::spdlog
dylib
# ImGui
GPUOpen::VulkanMemoryAllocator
Vulkan::Vulkan
)

target_compile_definitions(shadow-engine PRIVATE "EXPORTING_SH_ENGINE")
target_compile_definitions(shadow-engine
PRIVATE
EXPORTING_SH_ENGINE
)

target_link_options(shadow-engine PUBLIC -Wl,--export-all-symbols)
if (TRUE)

target_sources(shadow-engine PRIVATE
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_demo.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_sdl2.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_vulkan.cpp
)

add_executable(tests ${TEST_SOURCES} ${SOURCES} $<TARGET_OBJECTS:imgui>)
target_link_libraries(tests PRIVATE Catch2::Catch2 PUBLIC Vulkan::Vulkan SDL2::SDL2 spdlog dylib imgui)
target_include_directories(tests
PUBLIC ${IncludeDirs}
PRIVATE ${SDL2_INCLUDE_DIRS} ${glm_SOURCE_DIR}
INTERFACE
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends
)
target_compile_definitions(tests PRIVATE "EXPORTING_SH_ENGINE")
target_include_directories(shadow-engine
PUBLIC
${imgui_SOURCE_DIR}
${imgui_SOURCE_DIR}/backends
)

target_compile_definitions(shadow-engine
PRIVATE
IMGUI_USER_CONFIG="shadow/imguiConf.h"
)

# Enable testing on the executable
include(CTest)
include(Catch)
catch_discover_tests(tests)
endif ()
49 changes: 7 additions & 42 deletions projs/shadow/shadow-engine/assets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
<<<<<<<< HEAD:projs/shadow/shadow-engine/shadow-file-format/CMakeLists.txt
set(CMAKE_CXX_STANDARD 20)

# Set up Catch2 testing
list(APPEND CMAKE_MODULE_PATH "cmake")
enable_testing()
FILE(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/*.cpp
)

# Set up asset sourceset
FILE(GLOB_RECURSE SOURCES src/*.cpp src/*.h)
FILE(GLOB_RECURSE TESTS test/*.cpp)

add_library(shadow-asset ${SOURCES})

# Set up test executable
add_executable(shadow-asset-test ${TESTS})
target_link_libraries(shadow-asset-test PRIVATE Catch2::Catch2 shadow-utils)

# Enable testing on the executable
include(CTest)
include(Catch)
catch_discover_tests(shadow-asset-test)
========
set(CMAKE_CXX_STANDARD 20)

# Set up Catch2 testing
list(APPEND CMAKE_MODULE_PATH "cmake")
enable_testing()

# Set up asset sourceset
FILE(GLOB_RECURSE SOURCES src/**.cpp src/**.h)
FILE(GLOB_RECURSE TESTS test/*.cpp)

include_directories(src/)
add_library(shadow-asset ${SOURCES})

# Set up test executable
add_executable(shadow-asset-test ${TESTS})
target_link_libraries(shadow-asset-test PRIVATE Catch2::Catch2 shadow-utils)

# Enable testing on the executable
#include(CTest)
#include(Catch2)
#catch_discover_tests(shadow-asset-test)
>>>>>>>> 0009dc7 (File & FileSystem abstractions):projs/shadow/shadow-engine/assets/CMakeLists.txt
target_shadow_module(shadow-engine
SOURCES ${SOURCES}
INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/inc/
)

0 comments on commit 030c0c0

Please sign in to comment.