We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cmake_minimum_required(VERSION 3.2) project(foo) add_library(foo foo.cpp) target_compile_definitions(foo PUBLIC FOO_FEATURE) add_library(baz_1 baz_1.cpp) target_link_libraries(baz_1 PUBLIC foo) # Case 1 add_library(baz_2 baz_2.cpp) target_link_libraries(baz_2 PRIVATE foo) # Case 2 add_executable(boo_1 boo_1.cpp) target_link_libraries(boo_1 PRIVATE baz_1) add_executable(boo_2 boo_2.cpp) target_link_libraries(boo_2 PRIVATE baz_2)
/usr/bin/c++ -DFOO_FEATURE -o foo.cpp.o -c foo.cpp /usr/bin/c++ -DFOO_FEATURE -o baz_1.cpp.o -c baz_1.cpp /usr/bin/c++ -DFOO_FEATURE -o boo_1.cpp.o -c boo_1.cpp # FOO_FEATURE added, foo headers can be used in boo_1.cpp /usr/bin/c++ boo_1.cpp.o -o boo_1 libbaz_1.a libfoo.a # libfoo.a added, linking is static, we may need symbols /usr/bin/c++ -DFOO_FEATURE -o baz_2.cpp.o -c baz_2.cpp /usr/bin/c++ -o boo_2.cpp.o -c boo_2.cpp # FOO_FEATURE is missing, can't use foo headers in boo_2.cpp /usr/bin/c++ boo_2.cpp.o -o boo_2 libbaz_2.a libfoo.a # libfoo.a added even if PRIVATE used
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: