Skip to content

Commit c1745f3

Browse files
authored
perf: ビルド時間最適化(Phase 1-3) (#1140)
1 parent 571649c commit c1745f3

File tree

52 files changed

+847
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+847
-566
lines changed

.github/workflows/build_test.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
container: ghcr.io/ibis-ssl/crane:base
1919
env:
2020
DEBIAN_FRONTEND: noninteractive
21-
# # ccache configuration
22-
# PATH: /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
23-
# CC: /usr/lib/ccache/gcc
24-
# CXX: /usr/lib/ccache/g++
25-
# CCACHE_MAXSIZE: 10G
26-
# USE_CCACHE: 1
21+
# ccache configuration
22+
PATH: /usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
23+
CC: /usr/lib/ccache/gcc
24+
CXX: /usr/lib/ccache/g++
25+
CCACHE_MAXSIZE: 10G
26+
USE_CCACHE: 1
2727
strategy:
2828
fail-fast: false
2929
matrix:
@@ -88,11 +88,11 @@ jobs:
8888
# build-${{ matrix.rosdistro }}-${{ runner.os }}-${{ runner.arch }}-develop-
8989
# build-${{ matrix.rosdistro }}-${{ runner.os }}-${{ runner.arch }}-
9090

91-
# - name: Setup ccache
92-
# uses: hendrikmuhs/ccache-action@v1
93-
# with:
94-
# key: ${{ matrix.rosdistro }}-${{ runner.os }}-${{ github.head_ref || github.ref_name }}
95-
# max-size: 10G
91+
- name: Setup ccache
92+
uses: hendrikmuhs/ccache-action@v1
93+
with:
94+
key: ${{ matrix.rosdistro }}-${{ runner.os }}-${{ github.head_ref || github.ref_name }}
95+
max-size: 10G
9696

9797
- name: Run rosdep install
9898
run: |

3rdparty/closest_point_vendor/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(NOT CMAKE_CXX_STANDARD)
1212
endif()
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15-
add_compile_options(-Wall -Wextra -Wpedantic -g)
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
17+
add_compile_options(-g)
18+
endif()
1619
endif()
1720

1821
find_package(ament_cmake REQUIRED)

3rdparty/matplotlib_cpp_17_vendor/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(NOT CMAKE_CXX_STANDARD)
1212
endif()
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15-
add_compile_options(-Wall -Wextra -Wpedantic -g)
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
17+
add_compile_options(-g)
18+
endif()
1619
endif()
1720

1821
# find dependencies

3rdparty/rvo2_vendor/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(NOT CMAKE_CXX_STANDARD)
1212
endif()
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15-
add_compile_options(-Wall -Wextra -Wpedantic -g)
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
17+
add_compile_options(-g)
18+
endif()
1619
endif()
1720

1821
# find dependencies

consai_ros2/robocup_ssl_comm/CMakeLists.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(NOT CMAKE_CXX_STANDARD)
1212
endif()
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15-
add_compile_options(-Wall -Wextra -Wpedantic -g)
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
17+
add_compile_options(-g)
18+
endif()
1619
endif()
1720

1821
# find dependencies
@@ -38,6 +41,13 @@ target_link_libraries(game_controller_component
3841
robocup_ssl_msgs::robocup_ssl_msgs_proto
3942
)
4043

44+
# Enable Unity Build
45+
option(CRANE_UNITY_BUILD "Enable unity build" ON)
46+
if(CRANE_UNITY_BUILD)
47+
set_target_properties(game_controller_component PROPERTIES UNITY_BUILD ON)
48+
set_target_properties(game_controller_component PROPERTIES UNITY_BUILD_BATCH_SIZE 8)
49+
endif()
50+
4151
ament_auto_add_executable(game_controller_node
4252
src/game_controller_node.cpp
4353
)
@@ -51,6 +61,11 @@ ament_auto_add_library(grsim_component SHARED
5161
)
5262
target_link_libraries(grsim_component ${robocup_ssl_msgs_LIBRARIES})
5363

64+
if(CRANE_UNITY_BUILD)
65+
set_target_properties(grsim_component PROPERTIES UNITY_BUILD ON)
66+
set_target_properties(grsim_component PROPERTIES UNITY_BUILD_BATCH_SIZE 8)
67+
endif()
68+
5469
ament_auto_add_executable(grsim_node
5570
src/grsim_node.cpp
5671
)
@@ -64,6 +79,11 @@ ament_auto_add_library(tracker_component SHARED
6479
)
6580
target_link_libraries(tracker_component ${robocup_ssl_msgs_LIBRARIES})
6681

82+
if(CRANE_UNITY_BUILD)
83+
set_target_properties(tracker_component PROPERTIES UNITY_BUILD ON)
84+
set_target_properties(tracker_component PROPERTIES UNITY_BUILD_BATCH_SIZE 8)
85+
endif()
86+
6787
ament_auto_add_executable(tracker_node
6888
src/tracker_node.cpp
6989
)
@@ -77,6 +97,11 @@ ament_auto_add_library(vision_component SHARED
7797
)
7898
target_link_libraries(vision_component ${robocup_ssl_msgs_LIBRARIES})
7999

100+
if(CRANE_UNITY_BUILD)
101+
set_target_properties(vision_component PROPERTIES UNITY_BUILD ON)
102+
set_target_properties(vision_component PROPERTIES UNITY_BUILD_BATCH_SIZE 8)
103+
endif()
104+
80105
ament_auto_add_executable(vision_node
81106
src/vision_node.cpp
82107
)

crane_bringup/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(NOT CMAKE_CXX_STANDARD)
1212
endif()
1313

1414
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
15-
add_compile_options(-Wall -Wextra -Wpedantic -g)
15+
add_compile_options(-Wall -Wextra -Wpedantic)
16+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
17+
add_compile_options(-g)
18+
endif()
1619
endif()
1720

1821
# find dependencies

crane_debug_tools/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ if(NOT CMAKE_CXX_STANDARD)
77
endif()
88

99
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10-
add_compile_options(-Wall -Wextra -Wpedantic -g)
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
12+
add_compile_options(-g)
13+
endif()
1114
endif()
1215

1316
find_package(ament_cmake_auto REQUIRED)

crane_description/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ if(NOT CMAKE_CXX_STANDARD)
77
endif()
88

99
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10-
add_compile_options(-Wall -Wextra -Wpedantic -g)
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
12+
add_compile_options(-g)
13+
endif()
1114
endif()
1215

1316
# find dependencies

crane_game_analyzer/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ if(NOT CMAKE_CXX_STANDARD)
77
endif()
88

99
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10-
add_compile_options(-Wall -Wextra -Wpedantic -g)
10+
add_compile_options(-Wall -Wextra -Wpedantic)
11+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
12+
add_compile_options(-g)
13+
endif()
1114
endif()
1215

1316
add_definitions("-DBOOST_ALLOW_DEPRECATED_HEADERS")

crane_local_planner/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ if(NOT CMAKE_CXX_STANDARD)
77
endif()
88

99
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10-
add_compile_options(-Wall -Wextra -Wpedantic -g -Wno-unused-parameter -Wno-unused-variable)
10+
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-unused-variable)
11+
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
12+
add_compile_options(-g)
13+
endif()
1114
endif()
1215

1316
add_definitions("-DBOOST_ALLOW_DEPRECATED_HEADERS")

0 commit comments

Comments
 (0)