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

[CMakeToolchain]Adding visibility flag to CONAN_C_FLAGS #15762

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conan/tools/cmake/toolchain/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class AppleSystemBlock(Block):
if(CMAKE_GENERATOR MATCHES "Xcode")
message(DEBUG "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
else()
string(APPEND CONAN_C_FLAGS " ${BITCODE} ${FOBJC_ARC}")
string(APPEND CONAN_C_FLAGS " ${BITCODE} ${VISIBILITY} ${FOBJC_ARC}")
string(APPEND CONAN_CXX_FLAGS " ${BITCODE} ${VISIBILITY} ${FOBJC_ARC}")
endif()
""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_cmake_apple_bitcode_arc_and_visibility_flags_enabled(op_system, os_vers

client.run("create . --profile:build=default --profile:host=host -tf=")
# flags
assert "-- CONAN_C_FLAGS: -fembed-bitcode -fobjc-arc" in client.out
assert "-- CONAN_C_FLAGS: -fembed-bitcode -fvisibility=default -fobjc-arc" in client.out
assert "-- CONAN_CXX_FLAGS: -fembed-bitcode -fvisibility=default -fobjc-arc" in client.out
assert "[100%] Built target hello" in client.out

Expand Down Expand Up @@ -135,7 +135,7 @@ def test_cmake_apple_bitcode_arc_and_visibility_flags_disabled(op_system, os_ver

client.run("create . --profile:build=default --profile:host=host -tf=\"\"")
# flags
assert "-- CONAN_C_FLAGS: -fno-objc-arc" in client.out
assert "-- CONAN_C_FLAGS: -fvisibility=hidden -fvisibility-inlines-hidden -fno-objc-arc" in client.out
assert "-- CONAN_CXX_FLAGS: -fvisibility=hidden -fvisibility-inlines-hidden -fno-objc-arc" in client.out
assert "[100%] Built target hello" in client.out

Expand Down