Skip to content

Commit

Permalink
Fix Windows testing job
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Oct 19, 2023
1 parent 1cb3b89 commit 9aca425
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,6 @@ jobs:
# }

steps:
- name: Update MinGW to 10.2
if: ${{ matrix.config.platform == 'mingw' }}
run: |
for($i=0; ; $i++) {
choco upgrade mingw --version=10.2.0 --force
if (!$?) {
if ($i -le 3) {
continue
}
throw "choco upgrade mingw failed"
}
break
}
$gcc_version = &gcc -v 2>&1 | Out-String
$gcc_version
if ($gcc_version -NotMatch 'gcc version 10.2.0') {
throw "invalid gcc version detected"
}
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ if(MSVC)
# list(APPEND PRIVATE_COMPILE_OPTIONS /WX)
elseif(OC_COMPILER_IS_GCC OR OC_COMPILER_IS_CLANG)
oc_add_compile_options(GLOBAL
FLAGS -Wall -Wextra -pedantic
-Wwrite-strings -Wunused -Wunreachable-code -Wcast-align -Wpointer-arith
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
FLAGS -Wall -Wextra -pedantic
-Wwrite-strings -Wunused -Wunreachable-code -Wcast-align -Wpointer-arith -Wmissing-declarations
-fno-common
CFLAGS -Wmissing-prototypes -Wstrict-prototypes
)

if(NOT OC_CLANG_TIDY_ENABLED)
Expand Down Expand Up @@ -448,6 +448,9 @@ if(MINGW)
# force the use mingw_printf because the default doesn't support '%zu'
list(APPEND PRIVATE_COMPILE_DEFINITIONS "__USE_MINGW_ANSI_STDIO=(1)")
list(APPEND TEST_COMPILE_DEFINITIONS "__USE_MINGW_ANSI_STDIO=(1)")
if(BUILD_MBEDTLS)
list(APPEND MBEDTLS_COMPILE_DEFINITIONS "__USE_MINGW_ANSI_STDIO=(1)")
endif()
endif()

if(MSVC)
Expand Down
3 changes: 3 additions & 0 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ function(oc_add_app_executable)

add_executable(${OC_ADD_APP_EXECUTABLE_TARGET} ${OC_ADD_APP_EXECUTABLE_SOURCES})
target_compile_options(${OC_ADD_APP_EXECUTABLE_TARGET} PRIVATE ${PRIVATE_COMPILE_OPTIONS})
if(MINGW)
target_compile_definitions(${OC_ADD_APP_EXECUTABLE_TARGET} PRIVATE "__USE_MINGW_ANSI_STDIO=(1)")
endif()
target_link_libraries(${OC_ADD_APP_EXECUTABLE_TARGET} PUBLIC ${OC_ADD_APP_EXECUTABLE_DEPENDENCIES})

set(TARGET_STORAGE_FOLDER ${PROJECT_BINARY_DIR}/${OC_ADD_APP_EXECUTABLE_TARGET}_creds)
Expand Down

0 comments on commit 9aca425

Please sign in to comment.