Commit Graph

56 Commits (7742f025fcda64a3b5ac68d64d149858897630cf)

Author SHA1 Message Date
Gold856 7742f025fc Clean up MSVC flags to allow use of MSVC variables instead
Generator expressions were used to prevent the addition of /MD and /Zi if the CMake version is new enough to have specific MSVC variables for controlling those flags
2025-01-07 08:45:47 -05:00
Gold856 e08064d9e7 Use CMAKE_POSITION_INDEPENDENT_CODE instead of -fPIC 2025-01-07 07:53:33 -05:00
Gold856 6bb70df05b Use newer binary output directory variables and don't specify output directory on each target 2025-01-07 07:53:33 -05:00
Varun Agrawal 8f61d0b2ed mark private options as advanced and move GTSAM specific options to HandleGeneralOptions.cmake 2023-10-08 11:23:54 -04:00
Varun Agrawal 906b144580 change from /std:c++latest to /std:c++17 for Visual Studio 2023-04-10 21:12:57 -04:00
Frank Dellaert ad2f598245 Remove disable of warning not consistent across different clang versions 2023-02-20 12:54:56 -08:00
Frank Dellaert a8eb98acea Fixed warnings that arise from stricter compiler flags 2023-02-11 12:32:50 -08:00
Frank Dellaert 4c9743457c Get rid of indentation warnings in Eigen 2023-02-05 15:19:43 -08:00
Frank Dellaert e18b3c5078 Try adding directive in cmake 2023-02-05 11:01:24 -08:00
Frank Dellaert 1ecba12c6a Removed obsolete flag and TODOs 2023-01-20 23:11:12 -08:00
Frank Dellaert 0cb0733e33 Added c++17 flags to build functions 2023-01-19 22:33:32 -08:00
Varun Agrawal b34a8775bc clean up cmake and add comments 2022-12-23 23:07:44 +05:30
GAECHTER TOYA Stefan d1fa38457a Improve handling of GTSAM_BUILD_WITH_MARCH_NATIVE flag 2022-10-19 14:54:24 +02:00
GAECHTER TOYA Stefan ecd00f59d5 Check for native architecture and set GTSAM_COMPILE_OPTIONS_PUBLIC accordingly 2022-09-23 12:52:56 +02:00
Varun Agrawal 441ec33235 fix small issue 2022-07-07 11:09:56 -04:00
Jose Luis Blanco-Claraco 8f509dc326 Do not optimize native by default 2022-07-07 10:58:12 -04:00
Varun Agrawal 8c55ac729b check for mac silicon for march=native 2022-03-19 19:51:59 -04:00
Varun Agrawal d860e39561 suppress spurious warnings 2022-02-17 11:16:13 -05:00
Varun Agrawal 3d629290ee make non-editable CMake variables as INTERNAL 2021-01-22 13:21:09 -05:00
Jose-Luis Blanco Claraco 35aeaf5246
CMake scripts compatible with gtsam as git submodule 2021-01-17 22:21:53 +01:00
Jose Luis Blanco-Claraco 1da968afd3
Automatic detection of correct suggest-override flag 2020-10-28 07:43:16 +01:00
Frank dellaert 8a7ce130ad Fix warning on clang 2020-10-12 14:32:21 -04:00
Jose Luis Blanco Claraco e9e87526c4
refactor cmake scripts into smaller files 2020-10-06 18:10:11 +02:00
Jose Luis Blanco Claraco 8a9780113a
remove leftover cmake debug trace 2020-07-27 00:16:28 +02:00
Jose Luis Blanco Claraco 99256c6d28
relax override -Werror for now 2020-07-26 23:35:49 +02:00
Jose Luis Blanco Claraco 64fb7b9503
Avoid -Woverride in clang <12.0.0 2020-07-26 23:35:11 +02:00
Jose Luis Blanco Claraco 0198c648e3
Fix all new gcc warnings/errors: make explicit virtual/override methods.
Rules are:
- use "virtual" in base classes only.
- use "override" in all derived classes.
2020-07-26 11:20:42 +02:00
Jose Luis Blanco Claraco 4e3638f6a7
enable compiler warnings and errors for safer code 2020-07-26 08:41:57 +02:00
Varun Agrawal 289ab6271d added cmake policy for AppleClang compiler identification 2020-07-11 21:44:38 -04:00
Jose Luis Blanco-Claraco e658aed6bd
MSVC build fixes 2019-12-28 20:31:46 +01:00
Jose Luis Blanco Claraco 99856befce
Use gcc -fPIC flag when building gtsam libraries
This flag is required to ensure proper code generation for shared
libraries.
2019-11-11 23:22:17 +01:00
Jose Luis Blanco-Claraco 69c3eafb30
Add NOMINMAX macro for MSVC via cmake 2019-07-11 14:27:09 +02:00
Jose Luis Blanco Claraco 0a6fecd30b fix cmake warning 2019-06-16 02:30:28 +02:00
Jose Luis Blanco Claraco 7f43054c37 Refactor build flags via CMake target properties
Also:
- Allow users to edit cmake target build options in the cache variables.
- We had to add project() commands for  gtsam and gtsam_unstable,
the PROJECT_SOURCE_DIR changed, but the root GTSAM_SOURCE_DIR instead.
- Ensure use of standard C++11 (no extensions)
2019-06-15 23:09:54 +02:00
Jose Luis Blanco-Claraco ab8b2f5263 -march=native is not for MSVC 2019-06-02 11:32:38 +02:00
chrisbeall 7b9ed50daa Add option to toggle march=native 2019-05-18 15:15:27 -07:00
Abe fbe9aac41c squash local changes on top of gtsam upstream pull from 6/14/2016 2016-06-18 23:13:59 -07:00
Jing Dong a1b0408f5b fix CMAKE_BUILD_TYPE var to cache varible in default 2016-05-13 12:18:18 -04:00
Frank Dellaert 5a9ba414f6 Removed obsolete comment 2016-02-26 04:46:21 +00:00
Frank e7ba551523 I believe that this is the right way: CMAKE_CXX_FLAGS are set to -std=c++11 -Wall, and the different build types *append* to it. E.g., for Debug, the CMAKE_CXX_FLAGS_DEBUG (set from GTSAM_CMAKE_CXX_FLAGS_DEBUG) will be appended automatically. 2016-02-25 17:06:31 -08:00
Frank 8edf3042d8 Merge remote-tracking branch 'bitbucket/develop' into feature/improvements_and_bugfixes
Conflicts:
	cmake/GtsamBuildTypes.cmake
2016-02-24 17:36:02 -08:00
Enrique Fernandez 443bb0776b Set FLAGS for CMAKE_BUILD_TYPE None
Set the FLAGS to the ones from RelWithDebInfo CMAKE_BUILD_TYPE

See https://cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools

Without this, the C and CXX FLAGS are this (wrong):

--   C compilation flags            : -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security
-D_FORTIFY_SOURCE=2
--   C++ compilation flags          : -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security
-D_FORTIFY_SOURCE=2

and the compilation fails with this and similar errors (because C++11 is
needed):

gtsam/navigation/ImuFactor.cpp:144:15: error: ‘nullptr’ was not declared
in this scope
  return e != nullptr && base && pim;

With this changes, the C and CXX FLAGS are this (good):

--   C compilation flags            : -std=c11 -g -O3 -Wall -DNDEBUG
--   C++ compilation flags          : -std=c++11 -g -O3 -Wall -DNDEBUG

and everything compiles.
2016-02-24 17:05:12 -05:00
Enrique Fernandez 3226ec1d6a 💄 2016-02-24 17:05:07 -05:00
Frank 0372a959ee Many small improvements, bug-fixes, and tests 2016-02-24 11:01:19 -08:00
cbeall3 55ed99141e Add C++11 compiler flag to GtsamBuildTypes.cmake 2015-10-20 13:41:31 -04:00
Abe 13a4da21b2 misc bugfixes and cleanup from skydio 2015-05-13 22:26:24 -07:00
Thomas Schneider 279751c7a2 Remove -ftemplate-depth for apple with clang < 5.0. 2015-04-09 14:01:16 +02:00
Thomas Schneider 1ea5ae2253 Set -ftemplate-depth=1024 for all Clang compilers. Allows to compile
e.g. under Ubuntu with clang.
2015-04-09 13:41:14 +02:00
Chris Beall 7cdbac4b5c Fix warnings by latest CMake 3.1. Variables should be unquoted: Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. 2015-01-16 09:33:02 -05:00
cbeall3 53a24ed93a Add EIGEN_INITIALIZE_MATRICES_BY_NAN to Debug mode to resolve issue #184. 2014-12-04 12:40:11 -05:00