Skip to content

Commit

Permalink
Fix comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Dec 18, 2023
1 parent 0357857 commit dee9322
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
key: ${{ matrix.sys }}-mingw-${{ hashFiles('ext/*.cmd') }}
- name: Print cmake version
run: cmake --version
- name: Build libsharpyuv
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
run: ./libsharpyuv.cmd
- name: Build GoogleTest
if: steps.cache-ext.outputs.cache-hit != 'true'
working-directory: ./ext
Expand All @@ -68,6 +72,7 @@ jobs:
-DAVIF_CODEC_AOM=SYSTEM
-DAVIF_CODEC_AOM_DECODE=OFF -DAVIF_CODEC_AOM_ENCODE=ON
-DAVIF_CODEC_DAV1D=SYSTEM
-DAVIF_LIBSHARPYUV=LOCAL -DAVIF_LIBYUV=SYSTEM
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON
-DAVIF_BUILD_GDK_PIXBUF=ON -DCMAKE_INSTALL_PREFIX=./install
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ if(AVIF_BUILD_APPS)
endif()
target_link_libraries(avifdec avif_apps)
if(MINGW AND NOT "$ENV{MSYSTEM}" MATCHES "(MINGW32|MINGW64)")
# MINGW* are legacy environments that link against MSVCRT which does not support UTF8.
target_link_options(avifenc PRIVATE -municode)
target_link_options(avifdec PRIVATE -municode)
endif()
Expand Down
7 changes: 4 additions & 3 deletions apps/shared/avifutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern "C" {
#endif

// MAIN(), INIT_ARGV(), FREE_ARGV() for UTF8-aware command line parsing.
// UCRT supports UTF8, contrary to MSVCRT.
#if defined(_WIN32) && defined(_UCRT)
#define MAIN() int wmain(int argc, wchar_t * wargv[])
#else
Expand All @@ -21,7 +22,7 @@ extern "C" {
#ifdef __cplusplus
#define INIT_ARGV() \
if (setlocale(LC_ALL, ".UTF8") == NULL) { \
fprintf(stderr, "C++ setlocale failed\n"); \
fprintf(stderr, "setlocale failed\n"); \
return 1; \
} \
std::vector<char> argvAllVector(1024 * argc); \
Expand All @@ -40,7 +41,7 @@ extern "C" {
char * argvAll = NULL; \
char ** argv = NULL; \
if (setlocale(LC_ALL, ".UTF8") == NULL) { \
fprintf(stderr, "C setlocale failed\n"); \
fprintf(stderr, "setlocale failed\n"); \
return 1; \
} \
argvAll = (char *)malloc(1024 * argc * sizeof(*argvAll)); \
Expand All @@ -62,7 +63,7 @@ extern "C" {
#else
#define INIT_ARGV()
#endif
#if defined(_WIN32) && !defined(__cplusplus) && defined(_UCRT)
#if defined(_WIN32) && defined(_UCRT) && !defined(__cplusplus)
#define FREE_ARGV() \
free(argv); \
free(argvAll);
Expand Down
7 changes: 4 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,17 @@ endif()
# Bash tests

if(AVIF_BUILD_APPS)
add_test(NAME test_cmd COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/test_cmd.sh ${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/data
)
# When building apps, test the avifenc/avifdec.
# 'are_images_equal' is used to make sure inputs/outputs are unchanged.
add_executable(are_images_equal gtest/are_images_equal.cc)
target_link_libraries(are_images_equal aviftest_helpers)
add_test(NAME test_cmd COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/test_cmd.sh ${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/data
)
set_tests_properties(test_cmd PROPERTIES ENVIRONMENT "AVIF_TEST_UTF8=1")
if(MINGW)
if("$ENV{MSYSTEM}" MATCHES "(MINGW32|MINGW64)")
# Those legacy environments link against MSVCRT which does not support UTF8.
set_tests_properties(test_cmd PROPERTIES ENVIRONMENT "AVIF_TEST_UTF8=0")
else()
target_link_options(are_images_equal PRIVATE -municode)
Expand Down

0 comments on commit dee9322

Please sign in to comment.