Skip to content

Commit

Permalink
build shared lib only if BUILD_SHARED_LIBS is set (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: Hannes Harms <h.harms@grimme.de>
  • Loading branch information
hannes09 and Hannes Harms authored Jul 12, 2022
1 parent 90127c0 commit 16f9d25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option(FORCE_BUILD_VENDOR_PKG
OFF)

find_package(ament_cmake REQUIRED)
ament_add_default_options()

macro(build_yaml_cpp)
set(extra_cmake_args)
Expand All @@ -22,7 +23,9 @@ macro(build_yaml_cpp)
list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_TESTS=OFF")
list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_TOOLS=OFF")
list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_CONTRIB=OFF")
list(APPEND extra_cmake_args "-DYAML_BUILD_SHARED_LIBS=ON")
if(BUILD_SHARED_LIBS)
list(APPEND extra_cmake_args "-DYAML_BUILD_SHARED_LIBS=ON")
endif()
list(APPEND extra_cmake_args "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")

Expand Down

0 comments on commit 16f9d25

Please sign in to comment.