More work to drivers
- Add gfx_test - add texture loading to GfxOpenGL - add full submit code - add debug logging - add construct and destroy functionality to Pool - add command functionality - add vertex and index pools to lithium (static and not threadsafe yet) - Update GfxDriver Matrix with SetViewPort - Add glfw (only dependency of gfx_test) maybe later required for input driver
This commit is contained in:
107
CMakeLists.txt
107
CMakeLists.txt
@@ -14,89 +14,110 @@ option(PD_BUILD_SHARED "Build Shared Library" OFF)
|
||||
option(PD_BUILD_TOOLS "Build Palladium Tools" OFF)
|
||||
|
||||
if(${PD_BUILD_TOOLS})
|
||||
add_subdirectory(tools)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
||||
add_subdirectory(vendor)
|
||||
|
||||
# # Include Library Source
|
||||
set(PD_SOURCES
|
||||
# Common
|
||||
source/common.cpp
|
||||
|
||||
# Core
|
||||
source/core/bits.cpp
|
||||
source/core/color.cpp
|
||||
source/core/mat.cpp
|
||||
source/core/strings.cpp
|
||||
# Core
|
||||
source/core/bits.cpp
|
||||
source/core/color.cpp
|
||||
source/core/mat.cpp
|
||||
source/core/strings.cpp
|
||||
|
||||
source/drivers/os.cpp
|
||||
source/drivers/gfx.cpp
|
||||
# Drivers
|
||||
source/drivers/os.cpp
|
||||
source/drivers/gfx.cpp
|
||||
|
||||
# Lithium
|
||||
source/lithium/pools.cpp
|
||||
)
|
||||
|
||||
if(${PD_BUILD_SHARED})
|
||||
add_library(palladium SHARED ${PD_SOURCES})
|
||||
target_compile_definitions(palladium PRIVATE -DPD_BUILD_SHARED)
|
||||
add_library(palladium SHARED ${PD_SOURCES})
|
||||
target_compile_definitions(palladium PRIVATE -DPD_BUILD_SHARED)
|
||||
else()
|
||||
add_library(palladium STATIC ${PD_SOURCES})
|
||||
target_compile_definitions(palladium PUBLIC -DPD_BUILD_STATIC)
|
||||
add_library(palladium STATIC ${PD_SOURCES})
|
||||
target_compile_definitions(palladium PUBLIC -DPD_BUILD_STATIC)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(palladium PUBLIC -DPD_DEBUG=1)
|
||||
target_compile_options(palladium
|
||||
PUBLIC
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/source=source
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/include=include
|
||||
)
|
||||
|
||||
add_library(palladium::palladium ALIAS palladium)
|
||||
|
||||
target_include_directories(palladium
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_compile_options(palladium PRIVATE
|
||||
$<$<CONFIG:Debug>:-O0 -g>
|
||||
$<$<CONFIG:Release>:-O3>
|
||||
target_compile_options(palladium
|
||||
PRIVATE
|
||||
$<$<CONFIG:Debug>:-O0 -g>
|
||||
$<$<CONFIG:Release>:-O3>
|
||||
)
|
||||
|
||||
install(TARGETS palladium
|
||||
EXPORT palladiumTargets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
install(
|
||||
TARGETS palladium
|
||||
EXPORT palladiumTargets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
install(DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
install(
|
||||
DIRECTORY include/
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
install(EXPORT palladiumTargets
|
||||
FILE palladiumTargets.cmake
|
||||
NAMESPACE palladium::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
FILE palladiumTargets.cmake
|
||||
NAMESPACE palladium::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
cmake/palladiumConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfig.cmake
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
cmake/palladiumConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfig.cmake
|
||||
INSTALL_DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfigVersion.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfigVersion.cmake
|
||||
VERSION
|
||||
${PROJECT_VERSION}
|
||||
COMPATIBILITY
|
||||
SameMajorVersion
|
||||
)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/palladiumConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/palladium
|
||||
)
|
||||
|
||||
find_program(CLANG_FORMAT clang-format)
|
||||
|
||||
file(GLOB_RECURSE PD_FMTFILES CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp
|
||||
file(GLOB_RECURSE PD_FMTFILES
|
||||
CONFIGURE_DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp
|
||||
)
|
||||
|
||||
add_custom_target(pd-clang-format
|
||||
COMMAND ${CLANG_FORMAT} --style=file -i ${PD_FMTFILES}
|
||||
COMMENT "Formatting Project Sources"
|
||||
COMMAND ${CLANG_FORMAT} --style=file -i ${PD_FMTFILES}
|
||||
COMMENT "Formatting Project Sources"
|
||||
)
|
||||
|
||||
add_subdirectory(backends)
|
||||
|
||||
Reference in New Issue
Block a user