CMake does check for the compiler ids by compiling special C/C++ files. So no need to manually include from Module/Compiler or Module/Platform . This will be automatically done by CMake based on its compiler and platform checks.
CMAKE_C_COMPILER holds the name of the compiler. In general cmake uses this script to find the compiler.
About CMake. CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner.
You can set the position independent code property on all targets:
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
or in a specific library:
add_library(lib1 lib1.cpp)
set_property(TARGET lib1 PROPERTY POSITION_INDEPENDENT_CODE ON)
Reference: CMAKE_POSITION_INDEPENDENT_CODE cmake build system
You can also pass the following command line option to cmake
(in case this is not your cmake project and/or you can't or don't want to modify the project files):
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With