From b880e770225e3c2bc48801712f44dfad9f0a5312 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 3 Jun 2022 18:42:20 +0900 Subject: [PATCH 1/4] fix BUILD_C2A_AS_CXX option meaning on MSVC --- common.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.cmake b/common.cmake index 572062674..61be618c0 100644 --- a/common.cmake +++ b/common.cmake @@ -21,7 +21,9 @@ endif() 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++ + if(BUILD_C2A_AS_CXX) + target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++ + endif() target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8") else() # SJIS From bb4f98d3aad9a2ea430f8a7c19d52d46bf463acc Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 3 Jun 2022 18:55:06 +0900 Subject: [PATCH 2/4] add BUILD_C2A_AS_UTF8 option(default ON) --- CMakeLists.txt | 1 + common.cmake | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd5a509bd..54f6bb715 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(C2A_CORE) 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(BUILD_C2A_AS_UTF8 "build C2A as UTF-8" ON) set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/common.cmake b/common.cmake index 61be618c0..4d34f9f5b 100644 --- a/common.cmake +++ b/common.cmake @@ -24,7 +24,9 @@ if(MSVC) if(BUILD_C2A_AS_CXX) target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++ endif() - target_compile_options(${PROJECT_NAME} PUBLIC "/source-charset:utf-8") + 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") From dd4cffa154a1faebbba72d2a2cc3cf9eb21c5123 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 3 Jun 2022 18:58:32 +0900 Subject: [PATCH 3/4] add BUILD_C2A_AS_CXX description and default config(OFF) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54f6bb715..6d11df088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(C2A_CORE) 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(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}) From 13b184bd46fe283d6a8e49acd25e5d6b40ea0a50 Mon Sep 17 00:00:00 2001 From: sksat Date: Fri, 3 Jun 2022 19:15:02 +0900 Subject: [PATCH 4/4] add BUILD_C2A_AS_SILS_FW option(default ON) --- CMakeLists.txt | 2 ++ Examples/minimum_user_for_s2e/CMakeLists.txt | 3 ++- common.cmake | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d11df088..61a136e2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ project(C2A_CORE) 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) diff --git a/Examples/minimum_user_for_s2e/CMakeLists.txt b/Examples/minimum_user_for_s2e/CMakeLists.txt index 6acaafac7..df05c0895 100644 --- a/Examples/minimum_user_for_s2e/CMakeLists.txt +++ b/Examples/minimum_user_for_s2e/CMakeLists.txt @@ -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() @@ -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") diff --git a/common.cmake b/common.cmake index 4d34f9f5b..32826c341 100644 --- a/common.cmake +++ b/common.cmake @@ -17,6 +17,10 @@ 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")