Skip to content

Commit

Permalink
Revert "use unity builds"
Browse files Browse the repository at this point in the history
This reverts commit 6bf4fc7.
  • Loading branch information
Tyler-Lentz committed Apr 18, 2024
1 parent 6bf4fc7 commit 664bbc8
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 61 deletions.
14 changes: 5 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ FATAL: In-source builds are not allowed.
endif()

# enable build caching
# find_program(CCACHE ccache)
# if(CCACHE)
# set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
# set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
# endif(CCACHE)
find_program(CCACHE ccache)
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(CCACHE)

set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_STANDARD 20)
Expand Down Expand Up @@ -100,10 +100,6 @@ add_definitions( -DMAGICKCORE_HDRI_ENABLE=0 )
find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
# =============================

function(set_unity_for_target target_name)
set_target_properties(${target_name} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE BATCH UNITY_BUILD_BATCH_SIZE 16 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID")
endfunction()

# =============================
# obcpp library & executable

Expand Down
2 changes: 1 addition & 1 deletion protos
Submodule protos updated 1 files
+2 −2 obc.proto
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
add_library(obcpp_protos STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc)

add_subdirectory(camera)
add_subdirectory(core)
add_subdirectory(cv)
Expand All @@ -10,7 +8,6 @@ add_subdirectory(utilities)

add_library(obcpp_lib INTERFACE)
target_link_libraries(obcpp_lib INTERFACE
obcpp_protos
obcpp_camera
obcpp_core
obcpp_cv
Expand All @@ -23,7 +20,6 @@ target_link_libraries(obcpp_lib INTERFACE
# for use in unit tests
add_library(obcpp_lib_mock INTERFACE)
target_link_libraries(obcpp_lib_mock INTERFACE
obcpp_protos
obcpp_camera
obcpp_core
obcpp_cv
Expand Down
12 changes: 1 addition & 11 deletions src/camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,10 @@ set(FILES
mock.cpp
)

SET(LIB_DEPS
obcpp_protos
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
5 changes: 1 addition & 4 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set(FILES
)

set(LIB_DEPS
obcpp_protos
obcpp_camera
obcpp_cv
obcpp_network
Expand All @@ -16,16 +15,14 @@ set(LIB_DEPS
obcpp_utilities
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
11 changes: 2 additions & 9 deletions src/cv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@ set(FILES
utilities.cpp
)

set(LIB_DEPS
obcpp_protos
obcpp_utilities
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
obcpp_utilities
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
5 changes: 1 addition & 4 deletions src/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,20 @@ set(MOCK_FILES
)

set(LIB_DEPS
obcpp_protos
obcpp_utilities
obcpp_ticks
obcpp_core
obcpp_pathing
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
5 changes: 1 addition & 4 deletions src/pathing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ set(FILES
)

set (LIB_DEPS
obcpp_protos
obcpp_core
obcpp_network
obcpp_utilities
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS})

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
5 changes: 1 addition & 4 deletions src/ticks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@ set(FILES
)

set(LIB_DEPS
obcpp_protos
obcpp_pathing
obcpp_utilities
obcpp_core
obcpp_network
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down
12 changes: 1 addition & 11 deletions src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,10 @@ SET(FILES
rng.cpp
)

SET(LIB_DEPS
obcpp_protos
)

add_library(${LIB_NAME} STATIC
add_library(${LIB_NAME} STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc
${FILES}
)

target_link_libraries(${LIB_NAME} PRIVATE
${LIB_DEPS}
)

set_unity_for_target(${LIB_NAME})

target_add_protobuf(${LIB_NAME})
target_add_torch(${LIB_NAME})
# target_add_arena(${LIB_NAME}) # Tyler: currently broken, so we had to comment this out
Expand Down

0 comments on commit 664bbc8

Please sign in to comment.