Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buck-yeh-bux] fix clang-cl builds #26248

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions ports/buck-yeh-bux/fix-clang-cl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 306074e50..a032ab09e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,13 +5,13 @@ project(bux)
set(GNU_LIKE_CXX_FLAGS " -Wall -Wextra -Wshadow -Wconversion -Wno-parentheses -g3 -Og -std=c++20")
#string(APPEND CMAKE_CXX_FLAGS " -g3")

-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MSVC)
message("Clang")
string(APPEND CMAKE_CXX_FLAGS "${GNU_LIKE_CXX_FLAGS} -Wno-potentially-evaluated-expression")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message("GNU")
string(APPEND CMAKE_CXX_FLAGS "${GNU_LIKE_CXX_FLAGS}")
-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+elseif(MSVC)
message("MSVC")
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /std:c++latest /MP")
else()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 093a1da8d..8de40efa4 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,7 +8,7 @@ add_library(bux STATIC
XConsole.cpp XException.cpp
)
target_include_directories(bux PRIVATE ../include/bux)
-if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+if(MSVC)
target_link_libraries(bux PRIVATE fmt::fmt)
endif()

1 change: 1 addition & 0 deletions ports/buck-yeh-bux/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ vcpkg_from_github(
REF b046518dcffcdef9b8dbccd0accc2636df301766 # v1.6.6
SHA512 af1ca5c37623a09c64e1a84a630a26911be8c87eb007b112665b7c6080dfac67bd89eb36367202c5d29af97f4e549d6f27e41410220a57bd7756bdb1ecf8ddf0
HEAD_REF main
PATCHES fix-clang-cl.patch
)

vcpkg_cmake_configure(
Expand Down
1 change: 1 addition & 0 deletions ports/buck-yeh-bux/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "buck-yeh-bux",
"version": "1.6.6",
"port-version": 1,
"description": "A supplemental C++ library with functionalities not directly supported from Modern C++ standard.",
"homepage": "https://github.com/buck-yeh/bux",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/buck-yeh-bux.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f7bc53828c4e0a83a3242bb28682011495747ad2",
"version": "1.6.6",
"port-version": 1
},
{
"git-tree": "3d58f00b46ad32a1bfba6e5ee139aa47047e2bb6",
"version": "1.6.6",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@
},
"buck-yeh-bux": {
"baseline": "1.6.6",
"port-version": 0
"port-version": 1
},
"buck-yeh-bux-mariadb-client": {
"baseline": "1.0.3",
Expand Down