Added geometryc, shaderc just compiles vertexdecl.cpp, & misc cleanup

This commit is contained in:
Joshua Brookover
2016-09-15 21:01:28 -05:00
parent 27b5ef26dd
commit 80feda97d0
11 changed files with 76 additions and 2 deletions

View File

@@ -8,6 +8,10 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET fcpp )
return()
endif()
file( GLOB FCPP_SOURCES ${BGFX_DIR}/3rdparty/fcpp/*.c ${BGFX_DIR}/3rdparty/fcpp/*.h )
add_library( fcpp STATIC ${FCPP_SOURCES} )

19
cmake/3rdparty/forsyth-too.cmake vendored Normal file
View File

@@ -0,0 +1,19 @@
# bgfx.cmake - bgfx building in cmake
# Written in 2016 by Joshua Brookover <josh@jalb.me>
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET forsyth-too )
return()
endif()
file( GLOB FORSYTH-TOO_SOURCES ${BGFX_DIR}/3rdparty/forsyth-too/*.cpp ${BGFX_DIR}/3rdparty/forsyth-too/*.h )
add_library( forsyth-too STATIC ${FORSYTH-TOO_SOURCES} )
target_include_directories( forsyth-too PUBLIC ${BGFX_DIR}/3rdparty )
set_target_properties( forsyth-too PROPERTIES FOLDER "bgfx/3rdparty" )

View File

@@ -8,6 +8,10 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET glsl-optimizer )
return()
endif()
set( GLSL-OPTIMIZER_INCLUDES
${BGFX_DIR}/3rdparty/glsl-optimizer/include
${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa

View File

@@ -8,6 +8,10 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET ib-compress )
return()
endif()
file( GLOB IB_COMPRESS_SOURCES ${BGFX_DIR}/3rdparty/ib-compress/*.cpp ${BGFX_DIR}/3rdparty/ib-compress/*.h )
add_library( ib-compress STATIC ${IB_COMPRESS_SOURCES} )

View File

@@ -8,6 +8,10 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET ocornut-imgui )
return()
endif()
file( GLOB OCORNUT_IMGUI_SOURCES ${BGFX_DIR}/3rdparty/ocornut-imgui/*.cpp ${BGFX_DIR}/3rdparty/ocornut-imgui/*.h ${BGFX_DIR}/3rdparty/ocornut-imgui/*.inl )
add_library( ocornut-imgui STATIC ${OCORNUT_IMGUI_SOURCES} )

View File

@@ -123,7 +123,7 @@ function( add_example ARG_NAME )
endif()
# Directory name
set_target_properties( example-${ARG_NAME} PROPERTIES FOLDER "examples" )
set_target_properties( example-${ARG_NAME} PROPERTIES FOLDER "bgfx/examples" )
endfunction()
# Add common library for examples

18
cmake/shared.cmake Normal file
View File

@@ -0,0 +1,18 @@
# bgfx.cmake - bgfx building in cmake
# Written in 2016 by Joshua Brookover <josh@jalb.me>
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
add_library( bgfx-vertexdecl INTERFACE )
target_sources( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/src/vertexdecl.cpp )
target_include_directories( bgfx-vertexdecl INTERFACE ${BGFX_DIR}/include )
add_library( bgfx-bounds INTERFACE )
target_sources( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common/bounds.cpp )
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/include )
target_include_directories( bgfx-bounds INTERFACE ${BGFX_DIR}/examples/common )

View File

@@ -8,4 +8,5 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
include( cmake/tools/geometryc.cmake )
include( cmake/tools/shaderc.cmake )

View File

@@ -0,0 +1,19 @@
# bgfx.cmake - bgfx building in cmake
# Written in 2016 by Joshua Brookover <josh@jalb.me>
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
include( CMakeParseArguments )
include( cmake/3rdparty/forsyth-too.cmake )
include( cmake/3rdparty/ib-compress.cmake )
add_executable( geometryc bgfx/tools/geometryc/geometryc.cpp )
target_compile_definitions( geometryc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )
set_target_properties( geometryc PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries( geometryc bx bgfx-bounds bgfx-vertexdecl forsyth-too ib-compress )

View File

@@ -16,7 +16,7 @@ include( cmake/3rdparty/glsl-optimizer.cmake )
add_executable( shaderc bgfx/tools/shaderc/shaderc.cpp bgfx/tools/shaderc/shaderc.h bgfx/tools/shaderc/shaderc_glsl.cpp bgfx/tools/shaderc/shaderc_hlsl.cpp )
target_compile_definitions( shaderc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )
set_target_properties( shaderc PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries( shaderc bx bgfx fcpp glsl-optimizer )
target_link_libraries( shaderc bx bgfx-vertexdecl fcpp glsl-optimizer )
function( add_shader ARG_FILE )
# Parse arguments