Skip to content

Commit

Permalink
compiler toolchain tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
strasdat committed Jun 12, 2024
1 parent c28ee7d commit d395330
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
echo "Install test"
mkdir build_dir
cd build_dir
cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -DSOPHUS_ENABLE_ENSURE_HANDLER=$SOPHUS_ENABLE_ENSURE_HANDLER
cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -DBUILD_SOPHUS_TESTS=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DSOPHUS_ENABLE_ENSURE_HANDLER=$SOPHUS_ENABLE_ENSURE_HANDLER
# Ubuntu builds via Github actions run on 2-core virtual machines
make -j2
sudo make install
Expand Down
23 changes: 11 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(Sophus VERSION 1.24.06)
cmake_minimum_required(VERSION 3.24)
project(Sophus VERSION 1.24.6)

include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
Expand All @@ -24,20 +24,19 @@ if(SOPHUS_MASTER_PROJECT)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_COMPILE_WARNING_AS_ERROR Off)

# Set compiler specific settings (FixMe: Should not cmake do this for us
# automatically?)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wno-deprecated-register -Qunused-arguments -fcolor-diagnostics"
)
add_compile_options(-Wall -Wextra -Wno-deprecated-register
-Qunused-arguments -fcolor-diagnostics)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++14 -Wno-deprecated-declarations -ftemplate-backtrace-limit=0 -Wno-array-bounds"
)
add_compile_options(-Wall -Wextra -Wno-deprecated-declarations
-ftemplate-backtrace-limit=0 -Wno-array-bounds)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options(/bigobj /wd4305 /wd4244 /MP)
add_compile_definitions(_USE_MATH_DEFINES)
endif()

# Add local path for finding packages, set the local version first
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.24)

project(SophusExample)

find_package(Sophus 1.24.06 REQUIRED)
find_package(Sophus 1.24.6 REQUIRED)
set(CMAKE_CXX_STANDARD 17)

# Release by default Turn on Debug with "-DCMAKE_BUILD_TYPE=Debug"
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>sophus</name>
<version>1.24.06</version>
<version>1.24.6</version>
<description>
C++ implementation of Lie Groups using Eigen.
</description>
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_cpp_tests_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e # exit on error
mkdir build
cd build
pwd
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
# Ubuntu builds via Github actions run on 2-core virtual machines
make -j2
ctest --output-on-failure
2 changes: 1 addition & 1 deletion scripts/run_cpp_tests_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e # exit on error
mkdir build
cd build
pwd
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
# Ubuntu builds via Github actions run on 2-core virtual machines
make -j2
ctest --output-on-failure
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def main():
# logic and declaration, and simpler if you include description/version in a file.
setup(
name="sophus_pybind",
version="1.24.06",
version="1.24.6",
description="Sophus python API",
long_description="Python API for sophus library",
url="https://github.com/strasdat/sophus",
Expand Down

0 comments on commit d395330

Please sign in to comment.