Skip to content

Commit

Permalink
basisu vcpkg port: patch for mingw compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jun 6, 2024
1 parent 7af8907 commit cd06710
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .ci/vcpkg/overlay-ports/basisu/001-mingw.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 492233a..bdd4dac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,8 +102,10 @@ if (NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=0")
endif()
-
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -Wl,-rpath .")
+
+ if (NOT MINGW)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -Wl,-rpath .")
+ endif()
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COMPILE_FLAGS}")
@@ -123,6 +125,21 @@ else()
endif()
endif()

+# Set BASISU_HAVE_STD_TRIVIALLY_COPYABLE if the target supports std::is_trivially_copyable
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles("
+ #include <type_traits>
+ const bool val = std::is_trivially_copyable<bool>::value;
+ int main()
+ {
+ return 0;
+ }"
+ HAVE_STD_IS_TRIVIALLY_COPYABLE
+)
+if (HAVE_STD_IS_TRIVIALLY_COPYABLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_HAVE_STD_TRIVIALLY_COPYABLE")
+endif()
+
set(BASISU_SRC_LIST ${COMMON_SRC_LIST}
basisu_tool.cpp
encoder/basisu_backend.cpp
2 changes: 2 additions & 0 deletions .ci/vcpkg/overlay-ports/basisu/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vcpkg_from_github(
REF ad9386a4a1cf2a248f7bbd45f543a7448db15267 # post-1.16.4, including fixes
SHA512 4922af3a8d42d8c1ab551853d0ab97c0733a869cd99e95ef7a03620da023da48070a1255dcd68f6a384ee7787b5bd5dffe2cd510b2986e2a0e7181929f6ecc64
HEAD_REF master
PATCHES
001-mingw.patch
)

set(_additional_options)
Expand Down
2 changes: 1 addition & 1 deletion .ci/vcpkg/overlay-ports/basisu/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "basisu",
"version-string": "1.16.4",
"port-version": 1,
"port-version": 2,
"description": "Basis Universal is a supercompressed GPU texture and video compression format that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats.",
"homepage": "https://github.com/BinomialLLC/basis_universal",
"dependencies": [
Expand Down

0 comments on commit cd06710

Please sign in to comment.