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

Repairing MacOs build on develop #3977

Merged
merged 14 commits into from
Oct 20, 2023
5 changes: 3 additions & 2 deletions .github/build-iroha1.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -221,6 +221,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
2 changes: 1 addition & 1 deletion .github/chatops-gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echoerr(){
readonly ALL_oses="ubuntu macos windows" ALL_build_types="Debug Release" ALL_cmake_opts="normal burrow ursa" ALL_compilers="gcc-9 gcc-10 clang-10 clang llvm msvc"
readonly DEFAULT_oses="ubuntu macos windows" DEFAULT_build_types="Debug" DEFAULT_cmake_opts="normal burrow ursa"
readonly DEFAULT_ubuntu_compilers="gcc-9" AVAILABLE_ubuntu_compilers="gcc-9 gcc-10 clang-10"
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang gcc-10" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_windows_compilers="msvc" AVAILABLE_windows_compilers="msvc" ## Also "clang mingw cygwin" but they are redundant

--help-buildspec(){
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-iroha1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -235,6 +235,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
78 changes: 41 additions & 37 deletions iroha-lib/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
####### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)
if (APPLE)
message("iroha-lib does not support MacOS currently!")
else()
###### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)

target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_tx_example)
add_install_step_for_bin(irohalib_tx_example)


####### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)
###### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)

target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_batch_example)
add_install_step_for_bin(irohalib_batch_example)


####### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)
###### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)

target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_query_example)
add_install_step_for_bin(irohalib_query_example)


####### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)
###### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)

target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)
target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)

add_install_step_for_bin(irohalib_domainassetcreation_example)
add_install_step_for_bin(irohalib_domainassetcreation_example)
endif()
38 changes: 38 additions & 0 deletions vcpkg/patches/0014-gtest-remove-werror-compile-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake
index 11ac1140a..5226367cd 100644
--- a/ports/gtest/portfile.cmake
+++ b/ports/gtest/portfile.cmake
@@ -12,6 +12,7 @@ vcpkg_from_github(
0002-Fix-z7-override.patch
fix-main-lib-path.patch
fix-build-failure-in-gcc-11.patch
+ removing-werror-compiler-flag.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)
diff --git a/ports/gtest/removing-werror-compiler-flag.patch b/ports/gtest/removing-werror-compiler-flag.patch
new file mode 100644
index 000000000..2b7339da4
--- /dev/null
+++ b/ports/gtest/removing-werror-compiler-flag.patch
@@ -0,0 +1,20 @@
+diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
+index 4439cb9..e385a5a 100644
+--- a/googletest/cmake/internal_utils.cmake
++++ b/googletest/cmake/internal_utils.cmake
+@@ -82,13 +82,13 @@ macro(config_compiler_and_linker)
+ # http://stackoverflow.com/questions/3232669 explains the issue.
+ set(cxx_base_flags "${cxx_base_flags} -wd4702")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+- set(cxx_base_flags "-Wall -Wshadow -Werror -Wconversion")
++ set(cxx_base_flags "-Wall -Wshadow -Wconversion")
+ set(cxx_exception_flags "-fexceptions")
+ set(cxx_no_exception_flags "-fno-exceptions")
+ set(cxx_strict_flags "-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
+ set(cxx_no_rtti_flags "-fno-rtti")
+ elseif (CMAKE_COMPILER_IS_GNUCXX)
+- set(cxx_base_flags "-Wall -Wshadow -Werror")
++ set(cxx_base_flags "-Wall -Wshadow")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
+ set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else")
+ endif()