From 6e23a39de6c0e682d97cbce306e9854d328eeb74 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 20:36:16 +0300 Subject: [PATCH 1/7] Update submodules --- CMakeLists.txt | 2 +- bgfx | 2 +- bimg | 2 +- bx | 2 +- .../{astc-codec.cmake => astc-encoder.cmake} | 18 +++++++++--------- cmake/3rdparty/astc.cmake | 19 ------------------- cmake/bgfx.cmake | 2 +- cmake/bimg.cmake | 5 ++--- 8 files changed, 16 insertions(+), 36 deletions(-) rename cmake/3rdparty/{astc-codec.cmake => astc-encoder.cmake} (57%) delete mode 100644 cmake/3rdparty/astc.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6febbbc..9edab35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,7 @@ if( BGFX_INSTALL ) INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) if( NOT BGFX_LIBRARY_TYPE MATCHES "SHARED" ) - install( TARGETS bimg bx astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr + install( TARGETS bimg bx astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/bgfx b/bgfx index 8e94c8c..e841891 160000 --- a/bgfx +++ b/bgfx @@ -1 +1 @@ -Subproject commit 8e94c8c2db5a75f4b26d799e5cfd6279233fe96a +Subproject commit e841891a409a9d153bbdd967846ca7abb24acb05 diff --git a/bimg b/bimg index 90ac47d..1955d8f 160000 --- a/bimg +++ b/bimg @@ -1 +1 @@ -Subproject commit 90ac47dfb0ac21e602ed46a91fcc34016e565b98 +Subproject commit 1955d8f99af705fec6e704bfb90615cd7fd79545 diff --git a/bx b/bx index dbafa14..20efa22 160000 --- a/bx +++ b/bx @@ -1 +1 @@ -Subproject commit dbafa143d9901f2469c02ed6a29758f3654a7f5c +Subproject commit 20efa22f1894321c64384c85c142414973b91149 diff --git a/cmake/3rdparty/astc-codec.cmake b/cmake/3rdparty/astc-encoder.cmake similarity index 57% rename from cmake/3rdparty/astc-codec.cmake rename to cmake/3rdparty/astc-encoder.cmake index ef7db55..4727fb2 100644 --- a/cmake/3rdparty/astc-codec.cmake +++ b/cmake/3rdparty/astc-encoder.cmake @@ -8,21 +8,21 @@ # You should have received a copy of the CC0 Public Domain Dedication along with # this software. If not, see . -if( TARGET astc-codec ) +if( TARGET astc-encoder ) return() endif() file( GLOB - ASTC_CODEC_SOURCES - ${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.cc - ${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.h + ASTC_ENCODER_SOURCES + ${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp + ${BIMG_DIR}/3rdparty/astc-encoder/include/*.h ) -add_library( astc-codec STATIC ${ASTC_CODEC_SOURCES} ) -target_include_directories( astc-codec +add_library( astc-encoder STATIC ${ASTC_ENCODER_SOURCES} ) +target_include_directories( astc-encoder PUBLIC $ - $ - $ ) -set_target_properties( astc-codec PROPERTIES FOLDER "bgfx/3rdparty" ) \ No newline at end of file + $ + $ ) +set_target_properties( astc-encoder PROPERTIES FOLDER "bgfx/3rdparty" ) \ No newline at end of file diff --git a/cmake/3rdparty/astc.cmake b/cmake/3rdparty/astc.cmake deleted file mode 100644 index 371fea6..0000000 --- a/cmake/3rdparty/astc.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# bgfx.cmake - bgfx building in cmake -# Written in 2017 by Joshua Brookover - -# 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 . - -if( TARGET astc ) - return() -endif() - -file( GLOB ASTC_SOURCES ${BIMG_DIR}/3rdparty/astc/*.cpp ${BIMG_DIR}/3rdparty/astc/*.h ) - -add_library( astc STATIC ${ASTC_SOURCES} ) -target_include_directories( astc PUBLIC $ ) -set_target_properties( astc PROPERTIES FOLDER "bgfx/3rdparty" ) \ No newline at end of file diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 4d3ffe7..8ab838a 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -84,7 +84,7 @@ target_compile_definitions(bgfx target_include_directories( bgfx PRIVATE ${BGFX_DIR}/3rdparty - ${BGFX_DIR}/3rdparty/dxsdk/include + ${BGFX_DIR}/3rdparty/directx-headers/include/directx ${BGFX_DIR}/3rdparty/khronos PUBLIC $ diff --git a/cmake/bimg.cmake b/cmake/bimg.cmake index 13e92a4..9519b3a 100644 --- a/cmake/bimg.cmake +++ b/cmake/bimg.cmake @@ -9,8 +9,7 @@ # this software. If not, see . # Third party libs -include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-codec.cmake ) -include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc.cmake ) +include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-encoder.cmake ) include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/edtaa3.cmake ) include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc1.cmake ) include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc2.cmake ) @@ -39,7 +38,7 @@ target_include_directories( bimg $) # bimg dependencies -target_link_libraries( bimg PUBLIC bx PRIVATE astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr ) +target_link_libraries( bimg PUBLIC bx PRIVATE astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr ) # Put in a "bgfx" folder in Visual Studio set_target_properties( bimg PROPERTIES FOLDER "bgfx" ) \ No newline at end of file From 72ea9b6f296c6ac1a5ec3c7b595379da04b30969 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 21:00:43 +0300 Subject: [PATCH 2/7] Add other DX Headers --- cmake/bgfx.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 8ab838a..13e0bfd 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -84,7 +84,9 @@ target_compile_definitions(bgfx target_include_directories( bgfx PRIVATE ${BGFX_DIR}/3rdparty + ${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs ${BGFX_DIR}/3rdparty/directx-headers/include/directx + ${BGFX_DIR}/3rdparty/directx-headers/include ${BGFX_DIR}/3rdparty/khronos PUBLIC $ From 862912e7e94a536a6d694c9f490493563808a103 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 21:18:47 +0300 Subject: [PATCH 3/7] Fix WSL Include --- cmake/bgfx.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 13e0bfd..e73de0f 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -80,11 +80,17 @@ target_compile_definitions(bgfx "BGFX_CONFIG_MULTITHREADED=$" ) +# WSL Include dirs for UNIX +set (DXH_WSL) +if (UNIX) + set (DXH_WSL 3rdparty/directx-headers/include/wsl/stubs) +endif() + # Includes target_include_directories( bgfx PRIVATE ${BGFX_DIR}/3rdparty - ${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs + ${BGFX_DIR}/${DXH_WSL} ${BGFX_DIR}/3rdparty/directx-headers/include/directx ${BGFX_DIR}/3rdparty/directx-headers/include ${BGFX_DIR}/3rdparty/khronos From 99f17108ca6752da0f41bd66a8e840340e1e6143 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 21:25:03 +0300 Subject: [PATCH 4/7] Add linux compat for bx --- cmake/bx.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index 3c30a34..6ca27ea 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -59,6 +59,11 @@ elseif( WIN32 ) PUBLIC $ $ ) +elseif ( UNIX ) + target_include_directories( bx + PUBLIC + $ + $ ) elseif( APPLE ) target_include_directories( bx PUBLIC From 74a8e4dc72a4138c398b0d718ee2d5b10927d906 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 21:35:02 +0300 Subject: [PATCH 5/7] ordering matters --- cmake/bx.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index 6ca27ea..7045aa1 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -59,16 +59,16 @@ elseif( WIN32 ) PUBLIC $ $ ) +elseif( APPLE ) # APPLE is technically UNIX... ORDERING MATTERS! + target_include_directories( bx + PUBLIC + $ + $ ) elseif ( UNIX ) target_include_directories( bx PUBLIC $ $ ) -elseif( APPLE ) - target_include_directories( bx - PUBLIC - $ - $ ) endif() # All configurations From 9ee85d3c1b9769146165d5077e0dfe9e6b0e1302 Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 21:48:50 +0300 Subject: [PATCH 6/7] Fix directx-headers --- cmake/bgfx.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index e73de0f..5b98e6e 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -80,19 +80,24 @@ target_compile_definitions(bgfx "BGFX_CONFIG_MULTITHREADED=$" ) -# WSL Include dirs for UNIX -set (DXH_WSL) -if (UNIX) - set (DXH_WSL 3rdparty/directx-headers/include/wsl/stubs) +# directx-headers +set (DIRECTX_HEADERS) +if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID) # Only Linux + set (DIRECTX_HEADERS + ${BGFX_DIR}/3rdparty/directx-headers/include/directx + ${BGFX_DIR}/3rdparty/directx-headers/include + ${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs ) +elseif (WIN32) # Only Windows + set (DIRECTX_HEADERS + ${BGFX_DIR}/3rdparty/directx-headers/include/directx + ${BGFX_DIR}/3rdparty/directx-headers/include ) endif() # Includes target_include_directories( bgfx PRIVATE + ${DIRECTX_HEADERS} ${BGFX_DIR}/3rdparty - ${BGFX_DIR}/${DXH_WSL} - ${BGFX_DIR}/3rdparty/directx-headers/include/directx - ${BGFX_DIR}/3rdparty/directx-headers/include ${BGFX_DIR}/3rdparty/khronos PUBLIC $ From 9d3bc4f326ddebfb612d00bbc55167865fb30bcd Mon Sep 17 00:00:00 2001 From: e-erdal Date: Fri, 28 Oct 2022 22:21:19 +0300 Subject: [PATCH 7/7] Update bgfx submodule --- bgfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgfx b/bgfx index e841891..f6a1289 160000 --- a/bgfx +++ b/bgfx @@ -1 +1 @@ -Subproject commit e841891a409a9d153bbdd967846ca7abb24acb05 +Subproject commit f6a1289dbc60dfbf31da2fa5203475e41d1c5e9c