Skip to content

Commit

Permalink
[glog] Fix CUDA not working with NVCC compiler. (microsoft#28097)
Browse files Browse the repository at this point in the history
* [glog] Fix CUDA not working with NVCC compiler.

* update version

* update patch

* version
  • Loading branch information
FrankXie05 authored Dec 2, 2022
1 parent 1a6e66e commit eaa6e72
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ports/glog/fix_cplusplus_macro.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d145517..681b791 100644
index d145517..e8e1c90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -669,6 +669,10 @@ if (CYGWIN OR WIN32)
target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES)
endif (CYGWIN OR WIN32)

+if ((MSVC) AND (MSVC_VERSION GREATER_EQUAL 1914))
+ target_compile_options(glog INTERFACE "/Zc:__cplusplus")
+ target_compile_options(glog INTERFACE "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/Zc:__cplusplus>")
+endif()
+
if (WITH_CUSTOM_PREFIX)
Expand Down
8 changes: 5 additions & 3 deletions ports/glog/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ vcpkg_from_github(
fix_cplusplus_macro.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
unwind WITH_UNWIND
customprefix WITH_CUSTOM_PREFIX
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
unwind WITH_UNWIND
customprefix WITH_CUSTOM_PREFIX
)
file(REMOVE "${SOURCE_PATH}/glog-modules.cmake.in")

Expand Down
2 changes: 1 addition & 1 deletion ports/glog/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "glog",
"version": "0.6.0",
"port-version": 1,
"port-version": 2,
"description": "C++ implementation of the Google logging module",
"homepage": "https://github.com/google/glog",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,7 @@
},
"glog": {
"baseline": "0.6.0",
"port-version": 1
"port-version": 2
},
"gloo": {
"baseline": "20201203",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/glog.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cce45164ee522a505686c1794e7c228e44f52d76",
"version": "0.6.0",
"port-version": 2
},
{
"git-tree": "1fceaa6733361ea635af35ec1ce9b3caf47e0ffc",
"version": "0.6.0",
Expand Down

0 comments on commit eaa6e72

Please sign in to comment.