-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor example user IfWrapper CMake #532
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13) | |
|
||
project(C2A_USER_IF_WRAPPER) | ||
|
||
set(C2A_SRCS | ||
set(C2A_COMMON_SRCS | ||
if_list.c | ||
) | ||
|
||
|
@@ -11,40 +11,51 @@ if(USE_SILS_MOCKUP) | |
message("USE SILS_MOCKUP") | ||
|
||
#target_sources(${PROJECT_NAME} PRIVATE | ||
list(APPEND C2A_SRCS | ||
set(C2A_IF_IMPL_SRCS | ||
SilsMockup/ccsds_sils.c | ||
SilsMockup/i2c_sils.c | ||
SilsMockup/uart_sils.c | ||
SilsMockup/wdt_sils.c | ||
) | ||
else() | ||
#target_sources(${PROJECT_NAME} PUBLIC | ||
list(APPEND C2A_SRCS | ||
set(C2A_IF_IMPL_COMMON_SRCS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. オプションによって追加する側( basis でもないしなぁ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feature とか?でも表現以前に現在の実装が同じディレクトリにベチャッと撒かれてるだけだから,現時点であんまりカッコイイ表現をすべきでもないと思う(過剰な期待を抱いてしまう) |
||
Sils/ccsds_sils.cpp | ||
Sils/i2c_sils.cpp | ||
Sils/uart_sils.cpp | ||
Sils/wdt_sils.cpp | ||
) | ||
endif() | ||
|
||
if(USE_SCI_COM_WINGS AND NOT USE_SILS_MOCKUP) | ||
add_definitions(-DUSE_SCI_COM_WINGS) | ||
#target_sources(${PROJECT_NAME} PUBLIC | ||
list(APPEND C2A_SRCS | ||
Sils/ccsds_sils_sci_if.cpp | ||
) | ||
message("USE SCI_COM_WINGS") | ||
endif() | ||
if(USE_SCI_COM_WINGS) | ||
add_definitions(-DUSE_SCI_COM_WINGS) | ||
#target_sources(${PROJECT_NAME} PUBLIC | ||
set(C2A_IF_COM_WINGS_SRCS | ||
Sils/ccsds_sils_sci_if.cpp | ||
) | ||
message("USE SCI_COM_WINGS") | ||
endif() | ||
|
||
if(USE_SCI_COM_UART AND NOT USE_SILS_MOCKUP) | ||
add_definitions(-DUSE_SCI_COM_UART) | ||
#target_sources(${PROJECT_NAME} PUBLIC | ||
list(APPEND C2A_SRCS | ||
Sils/uart_sils_sci_if.cpp | ||
if(USE_SCI_COM_UART) | ||
add_definitions(-DUSE_SCI_COM_UART) | ||
#target_sources(${PROJECT_NAME} PUBLIC | ||
set(C2A_IF_COM_UART_SRCS | ||
Sils/uart_sils_sci_if.cpp | ||
) | ||
message("USE SCI_COM_UART") | ||
endif() | ||
|
||
set(C2A_IF_IMPL_SRCS | ||
${C2A_IF_IMPL_COMMON_SRCS} | ||
${C2A_IF_COM_WINGS_SRCS} | ||
${C2A_IF_COM_UART_SRCS} | ||
) | ||
message("USE SCI_COM_UART") | ||
endif() | ||
|
||
set(C2A_SRCS | ||
${C2A_COMMON_SRCS} | ||
${C2A_IF_IMPL_SRCS} | ||
) | ||
|
||
if(BUILD_C2A_AS_CXX) | ||
set_source_files_properties(${C2A_SRCS} PROPERTIES LANGUAGE CXX) # C++ | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文脈次第かな.
MOBC - 2nd OBC を com0com でつなげてSILSするときはそうなんだけど,
2nd OBC を直接WINGSに指すときはこれでいい.(そのOBCに対して,ペリフェラルを操作するためのUARTではなく,upstream 側の UART なんだけど,命名がな...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちなみに,ここなおすなら
Examples\2nd_obc_user\CMakeLists.txt
の L11 も直さないとだめThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは TODO comment に対する話?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L11 は指摘と現状の書き方の方が嘘で,これが正しい
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 文のネストが深くなっていることに注意(GitHub の表示だとたしかにちょっとわかりにくいけど)