Skip to content

Commit

Permalink
Merge pull request #81 from alicevision/dev_msvc
Browse files Browse the repository at this point in the history
Build fixes for MSVC
  • Loading branch information
laurentkneip committed Oct 25, 2018
2 parents ff42bff + 573fdde commit 306a54e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
27 changes: 14 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,32 @@ ELSE()
ENDIF()

IF(MSVC)
add_compile_options(/wd4514 /wd4267 $<$<CONFIG:DEBUG>:/bigobj>)
add_compile_options(/wd4514 /wd4267 /bigobj)
add_definitions(-D_USE_MATH_DEFINES)
ELSE()
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)|(aarch64)|(AARCH64)")
add_definitions (-Wall -march=armv8-a -O3)
add_definitions (-march=armv8-a)
ELSEIF (CMAKE_SYSTEM_PROCESSOR MATCHES
"(arm)|(ARM)|(armhf)|(ARMHF)|(armel)|(ARMEL)")
add_definitions (-Wall -march=armv7-a -O3)
add_definitions (-march=armv7-a)
ELSE ()
add_definitions (-Wall -march=native -O3) #TODO use correct c++11 def once everybody has moved to gcc 4.7 # for now I even removed std=gnu++0x
add_definitions (-march=native) #TODO use correct c++11 def once everybody has moved to gcc 4.7 # for now I even removed std=gnu++0x
ENDIF()
add_definitions (
-O3
-Wall
-Wextra
#-Werror
-Wwrite-strings
-Wno-unused-parameter
-fno-strict-aliasing
)
ENDIF()

IF(BUILD_POSITION_INDEPENDENT_CODE)
add_definitions( -fPIC )
ENDIF()

ADD_DEFINITIONS (
-Wall
-Wextra
#-Werror
-Wwrite-strings
-Wno-unused-parameter
-fno-strict-aliasing
)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/")
find_package(Eigen REQUIRED)
set(ADDITIONAL_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIR}/unsupported)
Expand Down
2 changes: 1 addition & 1 deletion src/absolute_pose/modules/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ opengv::absolute_pose::modules::upnp_main(
{
Eigen::Matrix<double,10,1> s;
upnp_fill_s(quaternion,s);
Eigen::Matrix<double,1,1> valueM = s.transpose() * M * s + 2.0 * C * s;
Eigen::Matrix<double,1,1> valueM = s.transpose() * M * s + C * s * 2.0;
double value = valueM[0] + gamma;

std::vector<std::pair<double,Eigen::Vector4d>,Eigen::aligned_allocator< std::pair<double,Eigen::Vector4d> > >::iterator
Expand Down
1 change: 1 addition & 0 deletions src/math/roots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <opengv/math/roots.hpp>
#include <complex>
#include <math.h>

std::vector<double>
opengv::math::o3_roots( const std::vector<double> & p )
Expand Down

0 comments on commit 306a54e

Please sign in to comment.