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

* [buck-yeh-bux] fix clang-cl

* v db
This commit is contained in:
Alexander Neumann 2022-08-10 20:23:06 +02:00 committed by GitHub
parent 1ed3a8935a
commit afa74ae0f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 1 deletions

View File

@ -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()

View File

@ -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(

View File

@ -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",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f7bc53828c4e0a83a3242bb28682011495747ad2",
"version": "1.6.6",
"port-version": 1
},
{
"git-tree": "3d58f00b46ad32a1bfba6e5ee139aa47047e2bb6",
"version": "1.6.6",

View File

@ -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",