Skip to content

Commit

Permalink
orion cmake configuration fails when CMAKE_C_COMPILED_ID is not set […
Browse files Browse the repository at this point in the history
…OI-1869] (#176)

## Jira Ticket

https://swift-nav.atlassian.net/browse/OI-1869

## Bug description

orion build fails with

```bash
CMake Error at third_party/orion-engine/third_party/auk/cmake/swift_nav/LanguageStandards.cmake:63 (if):
  if given arguments:

    "STREQUAL" "IAR"

  Unknown arguments specified
Call Stack (most recent call first):
  third_party/orion-engine/third_party/auk/cmake/swift_nav/SwiftTargets.cmake:351 (swift_set_language_standards)
  third_party/orion-engine/third_party/auk/cmake/swift_nav/SwiftTargets.cmake:373 (swift_add_target)
  proto/CMakeLists.txt:29 (swift_add_library)
```

CMake syntax allows using the variable without ${} to simultaneously
check if variable is defined, and variable content.


## Testing

Updated
`third_party/orion-engine/third_party/auk/cmake/swift_nav/LanguageStandards.cmake`
locally with the fix, CMake config runs correctly.
  • Loading branch information
armallen authored Jul 31, 2024
1 parent 65c9a39 commit 5b65c03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LanguageStandards.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function(swift_set_language_standards)
set(C_EXTENSIONS OFF)
endif()

if(${CMAKE_C_COMPILER_ID} STREQUAL "IAR")
if(CMAKE_C_COMPILER_ID STREQUAL "IAR")
set_target_properties(${x_UNPARSED_ARGUMENTS}
PROPERTIES
C_STANDARD_REQUIRED ON
Expand Down

0 comments on commit 5b65c03

Please sign in to comment.