Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
CMake and static linking - code-flow.club | Q&A

CMake and static linking


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
29 views
There is a small self-written parser cross-platform toy using SDL. The C++ Language. Under Win32 and Win64 is going in mingw-w64, gcc 4.5.1.

I want the following: in Assembly under Windows, link the dependencies statically. Not hunting to carry over a dozen libraries. Now in the build environment have both versions of libraries: static and dynamic linking. By default, gcc prefers to link dynamically. So he chose the static version of the libraries you want to add to them the key static. And then in front required libraries that are dynamically linkouts (OpenGL), add key -dynamic.

Question: how to make/teach cmake to collect the necessary command line?
by | 29 views

2 Answers

0 like 0 dislike
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Your code...
else()
Your code...
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
\r
\rwww.paraview.org/Wiki/CMake_Useful_Variables
by
0 like 0 dislike
If I remember correctly, for target_link_libraries no difference Libin static or dynamic.
If you want a specific option to the compiler or linker, in these cases, using set_target_properties. There are COMPILE_FLAGS and LINK_FLAGS, and lots of other things (see www.cmake.org/cmake/help/v2.8.12/cmake.html#section_PropertiesonTargets)
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,182 users