mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 13:48:30 +09:00
[Refactor] (buildsystem, 3rdparty): link test and benchmark to MobileGL library
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
project(MobileGLBenchmark)
|
||||
|
||||
message(STATUS "Generating build files for MobileGL Benchmark...")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
@@ -9,6 +11,10 @@ set(BENCHMARK_DOWNLOAD_DEPENDENCIES ON CACHE BOOL "Allow downloading benchmark d
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest tests")
|
||||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable testing")
|
||||
|
||||
set(LINK_LIBRARIES
|
||||
MobileGL_s
|
||||
)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
benchmark
|
||||
@@ -26,8 +32,9 @@ add_executable(SanityBench
|
||||
SanityBench.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(SanityBench
|
||||
PRIVATE benchmark::benchmark
|
||||
target_link_libraries(
|
||||
SanityBench PRIVATE
|
||||
benchmark::benchmark
|
||||
)
|
||||
|
||||
add_test(NAME SanityBench COMMAND SanityBench --benchmark_counters_tabular=true)
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# Add the directory containing our custom Find modules
|
||||
list(APPEND CMAKE_MODULE_PATH "${MGL_ROOT}/buildsystem/cmake")
|
||||
# # Add the directory containing our custom Find modules
|
||||
# list(APPEND CMAKE_MODULE_PATH "${MGL_ROOT}/buildsystem/cmake")
|
||||
|
||||
# Find the required libraries using our custom Find modules
|
||||
find_package(glslang REQUIRED)
|
||||
find_package(SPIRVCross REQUIRED)
|
||||
find_package(SPIRVTools)
|
||||
# # Find the required libraries using our custom Find modules
|
||||
# find_package(glslang REQUIRED)
|
||||
# find_package(SPIRVCross REQUIRED)
|
||||
# find_package(SPIRVTools)
|
||||
|
||||
message(STATUS "glslang_LIBRARIES: ${glslang_LIBRARIES}")
|
||||
message(STATUS "SPIRVTools_LIBRARIES: ${SPIRVTools_LIBRARIES}")
|
||||
message(STATUS "SPIRVCross_LIBRARIES: ${SPIRVCross_LIBRARIES}")
|
||||
# message(STATUS "glslang_LIBRARIES: ${glslang_LIBRARIES}")
|
||||
# message(STATUS "SPIRVTools_LIBRARIES: ${SPIRVTools_LIBRARIES}")
|
||||
# message(STATUS "SPIRVCross_LIBRARIES: ${SPIRVCross_LIBRARIES}")
|
||||
|
||||
# Set the libraries to link against
|
||||
set(LINK_LIBRARIES
|
||||
${glslang_LIBRARIES}
|
||||
${SPIRVCross_LIBRARIES}
|
||||
)
|
||||
# # Set the libraries to link against
|
||||
# set(LINK_LIBRARIES
|
||||
# ${glslang_LIBRARIES}
|
||||
# ${SPIRVCross_LIBRARIES}
|
||||
# )
|
||||
|
||||
if (SPIRVTools_FOUND)
|
||||
list(APPEND LINK_LIBRARIES ${SPIRVTools_LIBRARIES})
|
||||
endif()
|
||||
# if (SPIRVTools_FOUND)
|
||||
# list(APPEND LINK_LIBRARIES ${SPIRVTools_LIBRARIES})
|
||||
# endif()
|
||||
|
||||
add_executable(
|
||||
ProgramBench
|
||||
ProgramBench.cpp
|
||||
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ShaderObject.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ProgramState.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Program/GL_Program.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ShaderObject.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/ProgramState/ProgramState.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Program/GL_Program.cpp
|
||||
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToStr/GLEnumConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToGlslang/GLShaderLangConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/SpvcSession.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToStr/GLEnumConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToGlslang/GLShaderLangConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/ShaderCompiler.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/SpvcSession.cpp
|
||||
|
||||
${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/glslang/UniformTraverser.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/SPIRVCrossToGL/SpvcTypeConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/ShaderTranspiler/glslang/UniformTraverser.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/SPIRVCrossToGL/SpvcTypeConverter.cpp
|
||||
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/Core.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/BufferState/BufferState.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayState.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureUnit.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureState.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_State/GLState/ErrorState/Error.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Buffer/Validators.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/VertexArray/Validators.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/VertexArray/GL_VertexArray.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToStr/GLEnumConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/GLExtensionConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/BufferEnumConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/DataTypeConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToGlslang/GLShaderLangConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/ErrorCodeConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/BufferEnumConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/DataTypeConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToMG/BufferEnumConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToMG/DataTypeConverter.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Metrics/BufferMetrics.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Backend/Init.cpp
|
||||
${MGL_ROOT}/MobileGL/MG_Util/Debug/Log.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/Core.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/BufferState/BufferState.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/BufferState/BufferObject.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayState.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureUnit.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/TextureState/TextureState.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_State/GLState/ErrorState/Error.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Buffer/GL_Buffer.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/Buffer/Validators.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/VertexArray/Validators.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Impl/GLImpl/VertexArray/GL_VertexArray.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToStr/GLEnumConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/GLExtensionConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/BufferEnumConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToStr/DataTypeConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToGlslang/GLShaderLangConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/ErrorCodeConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/BufferEnumConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/MGToGL/DataTypeConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToMG/BufferEnumConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Converters/GLToMG/DataTypeConverter.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Metrics/BufferMetrics.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Backend/Init.cpp
|
||||
# ${MGL_ROOT}/MobileGL/MG_Util/Debug/Log.cpp
|
||||
)
|
||||
|
||||
target_include_directories(ProgramBench PRIVATE
|
||||
@@ -74,7 +74,7 @@ target_include_directories(ProgramBench PRIVATE
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
ProgramBench
|
||||
ProgramBench PRIVATE
|
||||
benchmark::benchmark
|
||||
${LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user