Skip to content

Commit e326eaf

Browse files
authored
Merge pull request #375 from EtienneAr/fix_pixi_build
Small fixes for pixi run build and tracy integrations
2 parents 88ed05d + b01d7ea commit e326eaf

File tree

5 files changed

+517
-482
lines changed

5 files changed

+517
-482
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- added support in Python bindings for `std::string_view` (converting to and from Python's `str` built-in type) (https://github.com/Simple-Robotics/aligator/pull/364)
1919
- change several classes (including solvers and contact-related modelling) to take `std::string_view` where possible (https://github.com/Simple-Robotics/aligator/pull/364)
2020
- fixed missing `num_threads` passed to `problem.evaluate()` in `SolverProxDDP::tryLinearStep()` (https://github.com/Simple-Robotics/aligator/pull/373)
21+
- Fix pixi build and Tracy integration issues: add ninja dependency and update configs (https://github.com/Simple-Robotics/aligator/pull/375)
2122

2223
### Changed
2324

CMakeLists.txt

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -287,50 +287,52 @@ list(
287287
)
288288

289289
option(DOWNLOAD_TRACY "Use FetchContent to install Tracy." OFF)
290-
if(ALIGATOR_TRACY_ENABLE AND DOWNLOAD_TRACY)
291-
# We use FetchContent_Populate because we need EXCLUDE_FROM_ALL to avoid
292-
# installing Tracy with aligator. We can directly use EXCLUDE_FROM_ALL in
293-
# FetchContent_Declare when CMake minimum version will be 3.28.
294-
if(POLICY CMP0169)
295-
cmake_policy(SET CMP0169 OLD)
296-
endif()
297-
FetchContent_Declare(
298-
tracy
299-
GIT_REPOSITORY https://github.com/Simple-Robotics/tracy.git
300-
GIT_TAG patches
301-
GIT_SHALLOW TRUE
302-
GIT_PROGRESS TRUE
303-
)
304-
FetchContent_GetProperties(tracy)
305-
if(NOT tracy_POPULATED)
306-
FetchContent_Populate(tracy)
307-
set(TRACY_STATIC ON CACHE INTERNAL "")
308-
set(TRACY_ENABLE ${ALIGATOR_TRACY_ENABLE} CACHE INTERNAL "")
309-
add_subdirectory(${tracy_SOURCE_DIR} ${tracy_BINARY_DIR} EXCLUDE_FROM_ALL)
310-
# Extract the target include directories, set as system
311-
get_target_property(
312-
tracy_INCLUDE_DIR
313-
TracyClient
314-
INTERFACE_INCLUDE_DIRECTORIES
315-
)
316-
set_target_properties(
317-
TracyClient
318-
PROPERTIES
319-
POSITION_INDEPENDENT_CODE True
320-
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${tracy_INCLUDE_DIR}"
321-
)
322-
endif()
323-
elseif(ALIGATOR_TRACY_ENABLE)
324-
# assume it is installed somewhere
325-
ADD_PROJECT_DEPENDENCY(Tracy)
326-
if(NOT ${tracy_FOUND})
327-
message(
328-
FATAL_ERROR
329-
"Aligator support for tracy is enabled, but tracy was not found on your system."
330-
" Install it, or set the option DOWNLOAD_TRACY to ON so we can fetch it."
290+
if(ALIGATOR_TRACY_ENABLE)
291+
if(DOWNLOAD_TRACY)
292+
# We use FetchContent_Populate because we need EXCLUDE_FROM_ALL to avoid
293+
# installing Tracy with aligator. We can directly use EXCLUDE_FROM_ALL in
294+
# FetchContent_Declare when CMake minimum version will be 3.28.
295+
if(POLICY CMP0169)
296+
cmake_policy(SET CMP0169 OLD)
297+
endif()
298+
FetchContent_Declare(
299+
tracy
300+
GIT_REPOSITORY https://github.com/Simple-Robotics/tracy.git
301+
GIT_TAG patches
302+
GIT_SHALLOW TRUE
303+
GIT_PROGRESS TRUE
331304
)
305+
FetchContent_GetProperties(tracy)
306+
if(NOT tracy_POPULATED)
307+
FetchContent_Populate(tracy)
308+
set(TRACY_STATIC ON CACHE INTERNAL "")
309+
set(TRACY_ENABLE ${ALIGATOR_TRACY_ENABLE} CACHE INTERNAL "")
310+
add_subdirectory(${tracy_SOURCE_DIR} ${tracy_BINARY_DIR} EXCLUDE_FROM_ALL)
311+
# Extract the target include directories, set as system
312+
get_target_property(
313+
tracy_INCLUDE_DIR
314+
TracyClient
315+
INTERFACE_INCLUDE_DIRECTORIES
316+
)
317+
set_target_properties(
318+
TracyClient
319+
PROPERTIES
320+
POSITION_INDEPENDENT_CODE True
321+
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${tracy_INCLUDE_DIR}"
322+
)
323+
endif()
332324
else()
333-
message(STATUS "Tracy found on your system at ${Tracy_DIR}")
325+
# assume it is installed somewhere
326+
ADD_PROJECT_DEPENDENCY(Tracy)
327+
if(NOT ${Tracy_FOUND})
328+
message(
329+
FATAL_ERROR
330+
"Aligator support for tracy is enabled, but tracy was not found on your system."
331+
" Install it, or set the option DOWNLOAD_TRACY to ON so we can fetch it."
332+
)
333+
else()
334+
message(STATUS "Tracy found on your system at ${Tracy_DIR}")
335+
endif()
334336
endif()
335337
endif()
336338

@@ -368,11 +370,17 @@ function(create_library)
368370
if(BUILD_WITH_OPENMP_SUPPORT)
369371
target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX)
370372
endif()
373+
374+
if(ALIGATOR_TRACY_ENABLE)
375+
target_link_libraries(${PROJECT_NAME} PUBLIC Tracy::TracyClient)
376+
endif()
377+
371378
target_link_libraries(
372379
${PROJECT_NAME}
373380
PUBLIC Eigen3::Eigen fmt::fmt
374381
PRIVATE mimalloc
375382
)
383+
376384
# set the install-tree include dirs used by dependent projects to consume this
377385
# target
378386
target_include_directories(

development/pixi/activation.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ export ALIGATOR_OPENMP_SUPPORT=${ALIGATOR_OPENMP_SUPPORT:=OFF}
3333
export ALIGATOR_BENCHMARKS=${ALIGATOR_BENCHMARKS:=ON}
3434
export ALIGATOR_EXAMPLES=${ALIGATOR_EXAMPLES:=ON}
3535
export ALIGATOR_PYTHON_STUBS=${ALIGATOR_PYTHON_STUBS:=ON}
36+
export ALIGATOR_TRACY_ENABLE=${ALIGATOR_TRACY_ENABLE:=OFF}

0 commit comments

Comments
 (0)