Skip to content

Commit a5c38a1

Browse files
author
Murilo M. Marinho
committed
[CMakeLists.txt] Changed to target_compile_options so that add_subdirectory propagates -fPIC to target.
1 parent 56f97d4 commit a5c38a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ endif()
1313

1414
project(dqrobotics)
1515

16+
set(CMAKE_CXX_STANDARD 17)
17+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
1619
find_package(Eigen3 REQUIRED)
1720

1821
# As of 2025.05, Not using GLOB_RECURSE as it's explicitly discouraged.
@@ -62,7 +65,9 @@ target_include_directories(dqrobotics PUBLIC
6265

6366
if(UNIX)
6467
# WIN32 does not accept these flags
65-
add_compile_options(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual -fPIC)
68+
target_compile_options(dqrobotics PUBLIC
69+
-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual -fPIC
70+
)
6671
endif()
6772

6873
if(WIN32)

0 commit comments

Comments
 (0)