Skip to content
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

Fix Windows testing job #549

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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