Skip to content

Commit

Permalink
CMake patches for QNX Support (#178)
Browse files Browse the repository at this point in the history
Patches to support building Starling on QNX

---------

Co-authored-by: Christian Reimer <christian.reimer@swift-nav.com>
  • Loading branch information
adharsh and reimerix authored Sep 6, 2024
1 parent fa93409 commit 5d9f739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lint:
max_branches: 40 # Default target: 12
max_arguments: 6 # Default target: 5
max_localvars: 15
max_statements: 125 # Default target: 50
max_statements: 130 # Default target: 50
encode:
emit_byteorder_mark: false
input_encoding: utf-8
Expand Down
4 changes: 4 additions & 0 deletions CompileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ function(swift_set_compile_options)
endif()
endif()

if(CMAKE_SYSTEM_NAME MATCHES "QNX")
list(APPEND all_flags -D_QNX_SOURCE)
endif ()

list(APPEND all_flags
-Wall
-Wcast-align
Expand Down
3 changes: 3 additions & 0 deletions TestTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ function(swift_add_test target)
endif()
if(x_LINK)
target_link_libraries(${target} PRIVATE ${x_LINK})
if(CMAKE_SYSTEM_NAME MATCHES "QNX")
target_link_libraries(${target} PRIVATE regex)
endif ()
endif()

if (NOT ${PROJECT_NAME}_BUILD_TESTS)
Expand Down

0 comments on commit 5d9f739

Please sign in to comment.