Compilation and Library Use
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cmake, cpp
- 领域
- build-system
调研方向
从 CMakeLists.txt 和 src/CMakeLists 开始,然后从下载的源代码归档中重现报告的构建,并针对 Unix 共享库进行重现。检查 issue 中描述的警告、版本检测和位置无关代码路径;当这些编译场景能够在没有报告的错误的情况下正常工作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
🤔 What's the problem you've observed?
Compilation
- Compilation without
.git(e.g. from downloaded Source Archive) leads to error causeCUKE_VERSIONcould not be determined - Use Library in a Shared Library requires compilation with
-fPICon Unix - Compilation error due to
-Werror:
include/asio/impl/error.ipp:34:15: error: ‘virtual const char* asio::error::detail::netdb_category::name() const’ can be marked override [-Werror=suggest-override]
✨ Do you have a proposal for making it better?
- If compiled from source archive the used CUKE_VERSION must be SET via Configure OR the source archive should contain a version file from which CMake could read the CUKE_VERSION
- Compile with flag -fPIC in Unix cases
- Remove -Werror, No warnings goal should be checked via github actions on merge / build
📚 Any additional context?
Below suggestion to remove the issues without greater changes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc98353..7b92ff4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,7 +98,7 @@ endif()
#
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Werror -Wall -Wextra -Wsuggest-override ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Wextra -Wsuggest-override ${CMAKE_CXX_FLAGS}")
# TODO: A better fix should handle ld's --as-needed flag
if(UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker '--no-as-needed'")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 466c37c..cda2006 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -127,7 +127,18 @@ foreach(TARGET
endif(MINGW)
endforeach()
-git_get_version(CUKE_VERSION)
+if(UNIX)
+ foreach(TARGET
+ cucumber-cpp-internal
+ cucumber-cpp-nomain
+ )
+ target_compile_options(${TARGET} PRIVATE -fPIC)
+ endforeach()
+endif()
+
+if("${CUKE_VERSION}" STREQUAL "")
+ git_get_version(CUKE_VERSION)
+endif()
message(STATUS "Version: ${CUKE_VERSION}")
target_compile_definitions(cucumber-cpp PRIVATE
CUKE_VERSION="${CUKE_VERSION}"
- 主要语言
- C++
- 星标
- 330
- 派生
- 142
- 平均合并
- 2 天 8 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cucumber/cucumber-cpp 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 45/100
cucumber/cucumber-cpp#317 ·
-
难度 5/5 一周以上 新手友好度 20/100
cucumber/cucumber-cpp#313 · 9 条评论 ·
-
Authorize hyphen "-" for Tag可能重新可做 @ursfassler 于 399 天前认领,目前没有进行中的 PR。 未关闭bug
cucumber/cucumber-cpp#312 · 4 条评论 · 已指派 1 人 ·
-
feature
难度 4/5 3-5 天 新手友好度 35/100
cucumber/cucumber-cpp#304 · 2 条评论 ·
-
help
难度 4/5 3-5 天 新手友好度 25/100
cucumber/cucumber-cpp#302 · 1 条评论 ·
查看 cucumber/cucumber-cpp 的全部 Issue
相似的 Issue
-
Build fails on macOS 27: dyld refuses stripped Rust proc-macros (mis-aligned LINKEDIT string pool)未关闭
难度 2/5 1-3 小时 新手友好度 73/100
cloudflare/workerd#8963 ·
维护者通常 1 天内回复
-
Android Bug Core Drape
难度 2/5 1-3 小时 新手友好度 77/100
organicmaps/organicmaps#14449 ·
维护者通常 1 天内回复
-
comp-codecs
难度 2/5 1-3 小时 新手友好度 84/100
ClickHouse/ClickHouse#135159 ·
维护者通常 1 天内回复
-
category:port-update
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 2 天内回复
-
difficulty:easy func:python os:windows prio:high type:bug
难度 2/5 1-3 小时 新手友好度 78/100
NatronGitHub/Natron#2029 ·
维护者通常 1 天内回复