<div dir="ltr">Tom,<div><br></div><div>I'll give that a try. Can that variable be changed after project() is called?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2019 at 5:24 PM Tom Finegan <<a href="mailto:tomfinegan@google.com">tomfinegan@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I think you want CMAKE_SHARED_LINKER_FLAGS:<div><br></div><div><a href="https://cmake.org/cmake/help/latest/variable/CMAKE_SHARED_LINKER_FLAGS.html" target="_blank">https://cmake.org/cmake/help/latest/variable/CMAKE_SHARED_LINKER_FLAGS.html</a><br></div><div><br></div><div>You can also use target_link_libraries to pass linker flags:</div><div><br></div><div><a href="https://cmake.org/cmake/help/latest/command/target_link_libraries.html" target="_blank">https://cmake.org/cmake/help/latest/command/target_link_libraries.html</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2019 at 1:12 PM Bryan Christ <<a href="mailto:bryan.christ@gmail.com" target="_blank">bryan.christ@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>For building my project on Linux with gcc I set the following.</div><div><br></div>set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")<br clear="all"><div><br></div><div>Later, if, the system appears to be OSX, I change it:</div><div><br></div><div>if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")<br><br> set(CMAKE_EXE_LINKER_FLAGS "-Wl,-undefined -Wl,dynamic_lookup")<br> set(CMAKE_PREFIX_PATH /usr/local/opt/ncurses)<br><br>endif()<br></div><div><br></div><div>However, when creating the shared object, linking fails. The flags are not being passed to clang as expected. When I dive into CMakeFile/vterm-shared.dir/link.txt I confirm that the wrong flags are there. </div><div><br></div><div>What am I doing wrong?</div><div><br></div>-- <br><div dir="ltr" class="gmail-m_-8662684139878260946gmail-m_7354553352887790270gmail_signature">Bryan<br><><</div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Bryan<br><><</div>