You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/cmake/Platform/Common
Chris Burel 8acda7d04d Prefer CMake's built-in `-fPIC` and `-fpie` support
CMake has a built-in property, `POSITION_INDEPENDENT_CODE`, that determines
if code will be built with `-fPIC`. This property is `True` by default for
`SHARED` and `MODULE` library targets and `False` otherwise. Previously,
we were always passing the `-fPIC` flag manually. With this change, we set
the appropriate CMake variable that will enable the property for all
compile jobs.

Furthermore, with CMake policy CMP0083 set to "new" (which happens by
default when the `cmake_minimum_required` version is >=3.14), CMake has
built-in support for passing the `-fpie` flag when building executables. It
uses the same property, `POSITION_INDEPENDENT_CODE`, so setting this
property (and enabling it with the CMake `CheckPIESupported` module) allows
us to use CMake's built-in support for these flags.

Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
..
Clang Prefer CMake's built-in `-fPIC` and `-fpie` support 4 years ago
GCC Linux Clang unoptimized build fix. (#7587) 4 years ago
MSVC Fixes for CMake 3.22rc (#5314) (#5580) 4 years ago
Configurations_common.cmake Prefer CMake's built-in `-fPIC` and `-fpie` support 4 years ago
Install_common.cmake Implemented Support to allow project's to reference gems via the gem name (#7109) 4 years ago
LYWrappers_default.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
PackagingPostBuild_common.cmake Creates a deb package (#5567) 4 years ago
PackagingPreBuild_common.cmake Creates a deb package (#5567) 4 years ago
RuntimeDependencies_common.cmake Detects changes in size of the copied runtime dependency (#5711) 4 years ago
TargetIncludeSystemDirectories_supported.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
TargetIncludeSystemDirectories_unsupported.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
runtime_dependencies_common.cmake.in Some fixes for paths with spaces (#6757) 4 years ago