Skip to content

Commit

Permalink
Merge pull request #339 from ut-issl/feature/options-for-real-user
Browse files Browse the repository at this point in the history
Fix/Add CMake build options for user
  • Loading branch information
sksat committed Jun 8, 2022
2 parents 0ede997 + 13b184b commit 6d2e320
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ option(USE_ALL_C2A_CORE_APPS "use C2A-core all Applications" ON)
option(USE_ALL_C2A_CORE_LIB "use C2A-core all Library" ON)
option(USE_32BIT_COMPILER "use 32bit compiler" OFF)

option(BUULD_C2A_AS_SILS_FW "build C2A as SILS firmware" ON)
option(BUILD_C2A_AS_CXX "build C2A as C++" OFF)
option(BUILD_C2A_AS_UTF8 "build C2A as UTF-8" ON)

set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(C2A_SRCS
Expand Down
3 changes: 2 additions & 1 deletion Examples/minimum_user_for_s2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ option(USE_SCI_COM_UART "Use SCI_COM_UART" OFF)

option(USE_SILS_MOCKUP "Use SILS mockup for build C2A with minimal user in C89 only" OFF)

option(BUILD_C2A_AS_SILS_FW "Build C2A as SILS firmware" ON)

if(USE_SILS_MOCKUP)
set(BUILD_C2A_AS_CXX OFF)
endif()
Expand All @@ -31,7 +33,6 @@ set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/src_core)
set(C2A_USER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/src_user)

include_directories(src)
add_definitions(-DSILS_FW)

# Output debug print to SILS console window
option(SHOW_DEBUG_PRINT_ON_SILS "Show debug print")
Expand Down
12 changes: 10 additions & 2 deletions common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ else()
endif()
endif()

if(BUULD_C2A_AS_SILS_FW)
target_compile_definitions(${PROJECT_NAME} PUBLIC SILS_FW)
endif()

# Build option
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
target_compile_options(${PROJECT_NAME} PUBLIC "/MT")
target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++
target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8")
if(BUILD_C2A_AS_CXX)
target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++
endif()
if(BUILD_C2A_AS_UTF8)
target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8")
endif()
else()
# SJIS
# if (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
Expand Down

0 comments on commit 6d2e320

Please sign in to comment.