Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
protobuf-c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
protobuf-c
Commits
0b629e68
Unverified
Commit
0b629e68
authored
Apr 27, 2024
by
Robert Edmonds
Committed by
GitHub
Apr 27, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #714 from clementperon/fix_cmake
Fix CI issues with CMake
parents
5c13d7df
af0ea6fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
.github/workflows/build.yml
.github/workflows/build.yml
+12
-4
build-cmake/CMakeLists.txt
build-cmake/CMakeLists.txt
+20
-9
No files found.
.github/workflows/build.yml
View file @
0b629e68
...
@@ -17,7 +17,9 @@ jobs:
...
@@ -17,7 +17,9 @@ jobs:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Install Linux dependencies
-
name
:
Install Linux dependencies
if
:
startsWith(matrix.os, 'ubuntu')
if
:
startsWith(matrix.os, 'ubuntu')
run
:
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev
run
:
|
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev
-
name
:
Install Mac dependencies
-
name
:
Install Mac dependencies
if
:
startsWith(matrix.os, 'macos')
if
:
startsWith(matrix.os, 'macos')
run
:
brew install protobuf automake
run
:
brew install protobuf automake
...
@@ -60,7 +62,9 @@ jobs:
...
@@ -60,7 +62,9 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev valgrind
run
:
|
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev valgrind
-
name
:
Run distcheck with valgrind
-
name
:
Run distcheck with valgrind
run
:
|
run
:
|
./autogen.sh
./autogen.sh
...
@@ -72,7 +76,9 @@ jobs:
...
@@ -72,7 +76,9 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev lcov
run
:
|
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev lcov
-
name
:
Run coverage build
-
name
:
Run coverage build
run
:
|
run
:
|
./autogen.sh
./autogen.sh
...
@@ -96,7 +102,9 @@ jobs:
...
@@ -96,7 +102,9 @@ jobs:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Install Linux dependencies
-
name
:
Install Linux dependencies
if
:
startsWith(matrix.os, 'ubuntu')
if
:
startsWith(matrix.os, 'ubuntu')
run
:
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev
run
:
|
sudo apt-get update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev
-
name
:
Install Mac dependencies
-
name
:
Install Mac dependencies
if
:
startsWith(matrix.os, 'macos')
if
:
startsWith(matrix.os, 'macos')
run
:
brew install protobuf abseil
run
:
brew install protobuf abseil
...
...
build-cmake/CMakeLists.txt
View file @
0b629e68
...
@@ -8,6 +8,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
...
@@ -8,6 +8,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)
cmake_policy
(
SET CMP0074 NEW
)
cmake_policy
(
SET CMP0074 NEW
)
cmake_policy
(
SET CMP0091 NEW
)
cmake_policy
(
SET CMP0091 NEW
)
cmake_policy
(
SET CMP0112 NEW
)
cmake_policy
(
SET CMP0112 NEW
)
# TODO: Convert DART to CTEST
if
(
POLICY CMP0145
)
cmake_policy
(
SET CMP0145 OLD
)
endif
()
PROJECT
(
protobuf-c C CXX
)
PROJECT
(
protobuf-c C CXX
)
...
@@ -15,7 +19,14 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
...
@@ -15,7 +19,14 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
SET
(
Protobuf_USE_STATIC_LIBS ON
)
SET
(
Protobuf_USE_STATIC_LIBS ON
)
endif
(
MSVC AND NOT BUILD_SHARED_LIBS
)
endif
(
MSVC AND NOT BUILD_SHARED_LIBS
)
FIND_PACKAGE
(
Protobuf REQUIRED
)
FIND_PACKAGE
(
Protobuf CONFIG
)
if
(
Protobuf_FOUND
)
# Keep compatibility with FindProtobuf CMake module
set
(
PROTOBUF_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>
)
else
()
MESSAGE
(
STATUS
"Protobuf CMake config not found fallback to Cmake Module"
)
FIND_PACKAGE
(
Protobuf REQUIRED
)
endif
()
file
(
REAL_PATH
"
${
PROTOBUF_INCLUDE_DIR
}
"
PROTOBUF_INCLUDE_DIR
)
file
(
REAL_PATH
"
${
PROTOBUF_INCLUDE_DIR
}
"
PROTOBUF_INCLUDE_DIR
)
INCLUDE_DIRECTORIES
(
${
PROTOBUF_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
PROTOBUF_INCLUDE_DIR
}
)
...
@@ -112,7 +123,7 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
...
@@ -112,7 +123,7 @@ if (MSVC AND NOT BUILD_SHARED_LIBS)
foreach
(
flag_var
foreach
(
flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_FLAGS_RELWITHDEBINFO
)
CMAKE_C_FLAGS_MINSIZEREL CMAKE_FLAGS_RELWITHDEBINFO
)
if
(
${
flag_var
}
MATCHES
"/MD"
)
if
(
${
flag_var
}
MATCHES
"/MD"
)
string
(
REGEX REPLACE
"/MD"
"/MT"
${
flag_var
}
"
${${
flag_var
}}
"
)
string
(
REGEX REPLACE
"/MD"
"/MT"
${
flag_var
}
"
${${
flag_var
}}
"
)
...
@@ -209,7 +220,7 @@ GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full
...
@@ -209,7 +220,7 @@ GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full
ADD_EXECUTABLE
(
cxx-generate-packed-data
${
TEST_DIR
}
/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h
)
ADD_EXECUTABLE
(
cxx-generate-packed-data
${
TEST_DIR
}
/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h
)
TARGET_LINK_LIBRARIES
(
cxx-generate-packed-data
TARGET_LINK_LIBRARIES
(
cxx-generate-packed-data
${
PROTOBUF_LIBRARY
}
protobuf::libprotobuf
${
protobuf_ABSL_USED_TARGETS
}
${
protobuf_ABSL_USED_TARGETS
}
${
protobuf_UTF8_USED_TARGETS
}
${
protobuf_UTF8_USED_TARGETS
}
)
)
...
@@ -316,12 +327,12 @@ ADD_TEST(test-version test-version)
...
@@ -316,12 +327,12 @@ ADD_TEST(test-version test-version)
if
(
WIN32
)
if
(
WIN32
)
set_tests_properties
(
set_tests_properties
(
test-generated-code
test-generated-code
test-generated-code2
test-generated-code2
test-generated-code3
test-generated-code3
test-issue220
test-issue220
test-issue251
test-issue251
test-version
test-version
PROPERTIES ENVIRONMENT
"PATH=
${
WINDOWS_PATH_VARIABLE
}
\\
;$<TARGET_FILE_DIR:protoc-gen-c>"
)
PROPERTIES ENVIRONMENT
"PATH=
${
WINDOWS_PATH_VARIABLE
}
\\
;$<TARGET_FILE_DIR:protoc-gen-c>"
)
endif
(
WIN32
)
endif
(
WIN32
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment