On Wed, 15 Feb 2023 at 01:34, Simon Eves <simon.e...@heavy.ai> wrote: > > I tried adding -DCMAKE_CPP_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" to the > OpenJPEG build CMake invocation, but that made no difference. >
More CMake-idiomatic way is to use -DCMAKE_POSITION_INDEPENDENT_CODE=ON instead. It used to be there https://github.com/OSGeo/gdal/commit/a0128debca5dd77a64188cc7ac3ba60866a70e89 until https://github.com/OSGeo/gdal/issues/5649 and there is GDAL-specific variable now -DGDAL_OBJECT_LIBRARIES_POSITION_INDEPENDENT_CODE=ON https://github.com/OSGeo/gdal/blob/master/gdal.cmake#L42-L43 Best regards, -- Mateusz Loskot, http://mateusz.loskot.net _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev