Skip to content

Commit

Permalink
fix cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingrabbit committed Nov 28, 2021
1 parent 8f1e1ee commit c5c4920
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_as_c89.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DUSE_SILS_MOCKUP=ON -DCMAKE_C_FLAGS="-Werror"
cmake .. -DUSE_SILS_MOCKUP=ON -DADD_WERROR_FLAGS=OK
- name: build
working-directory: ./Examples/minimum_user_for_s2e/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_as_c89_wextra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DUSE_SILS_MOCKUP=ON -DCMAKE_C_FLAGS="-Wextra"
cmake .. -DUSE_SILS_MOCKUP=ON -DADD_WEXTRA_FLAGS=OK
- name: build
working-directory: ./Examples/minimum_user_for_s2e/build
Expand Down
10 changes: 8 additions & 2 deletions Examples/minimum_user_for_s2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,16 @@ endif()

# Compile option
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++
target_compile_options(${PROJECT_NAME} PUBLIC "/W4")
target_compile_options(${PROJECT_NAME} PUBLIC "/TP") # Compile C codes as C++
else()
target_compile_options(${PROJECT_NAME} PUBLIC "${CMAKE_CXX_FLAGS}-Wall")
set(CMAKE_CXX_FLAGS "-finput-charset=cp932 -m32 -rdynamic -Wall -g -Wno-unknown-pragma") # SJIS, 32bit
set(CMAKE_C_FLAGS "-finput-charset=cp932 -m32 -rdynamic -Wall -g -Wno-unknown-pragmas") # SJIS, 32bit
if(ADD_WERROR_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif()
if(ADD_WEXTRA_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
endif()
endif()

0 comments on commit c5c4920

Please sign in to comment.