Skip to content

Commit

Permalink
馃洜 Better flags for Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Oct 8, 2022
1 parent 5173d67 commit 6d89e5f
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

- name: configure
run: |
cmake -B build/debug "-DCMAKE_CXX_FLAGS_INIT=/Wv:18" "-DCMAKE_C_FLAGS_INIT=/Wv:18" -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON
cmake -B build/release "-DCMAKE_CXX_FLAGS_INIT=/Wv:18" "-DCMAKE_C_FLAGS_INIT=/Wv:18" -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON
cmake -B build/debug "-DCMAKE_CXX_FLAGS_INIT=/Wv:18" "-DCMAKE_C_FLAGS_INIT=/Wv:18" -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON -D ZTD_TEXT_BOOST.TEXT=OFF
cmake -B build/release "-DCMAKE_CXX_FLAGS_INIT=/Wv:18" "-DCMAKE_C_FLAGS_INIT=/Wv:18" -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON -D ZTD_TEXT_BOOST.TEXT=OFF
- name: build
run: |
Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,18 @@ if(ZTD_TEXT_IS_TOP_LEVEL_PROJECT)
if(ZTD_TEXT_BENCHMARKS OR ZTD_TEXT_EXAMPLES OR ZTD_TEXT_TESTS OR ZTD_TEXT_SCRATCH)
# normal flags
check_compiler_flag(disable-permissive MSVC /permissive- GCC -pedantic)
check_compiler_flag(utf8-literal-encoding MSVC /execution-charset:utf-8 GCC -fexec-charset=utf-8)
check_compiler_flag(utf8-source-encoding MSVC /source-charset:utf-8 GCC -finput-charset=utf-8)
check_compiler_flag(extra-constexpr-depth MSVC /constexpr:depth2147483647 GCC -fconstexpr-depth=2147483647 Clang -fconstexpr-depth=2147483647 LANGUAGES CXX)
check_compiler_flag(extra-constexpr-steps MSVC /constexpr:steps2147483647 GCC -fconstexpr-ops-limit=2147483647 Clang -fconstexpr-steps=2147483647 LANGUAGES CXX)
check_compiler_flag(template-debugging-mode GCC -ftemplate-backtrace-limit=0 LANGUAGES CXX)

# Warning flags
check_compiler_flag(warn-pedantic MSVC /permissive- GCC -pedantic)
check_compiler_flag(warn-all MSVC /W4 GCC -Wall)
check_compiler_flag(warn-errors MSVC /WX GCC -Werror)
check_compiler_flag(warn-extra GCC -Wextra Clang -Wextra)
check_compiler_flag(utf8-literal-encoding MSVC /execution-charset:utf-8 GCC -fexec-charset=utf-8)
check_compiler_flag(utf8-source-encoding MSVC /source-charset:utf-8 GCC -finput-charset=utf-8)
check_compiler_flag(extra-constexpr-depth MSVC /constexpr:depth2147483647 GCC -fconstexpr-depth=2147483647 Clang -fconstexpr-depth=2147483647)
check_compiler_flag(extra-constexpr-steps MSVC /constexpr:steps2147483647 GCC -fconstexpr-ops-limit=2147483647 Clang -fconstexpr-steps=2147483647)
check_compiler_flag(template-debugging-mode GCC -ftemplate-backtrace-limit=0)
check_compiler_diagnostic(alignas-extra-padding MSVC 4324 LANGUAGES CXX)
endif()
endif()

Expand Down
4 changes: 3 additions & 1 deletion benchmarks/barrier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ target_compile_options(ztd.text.benchmarks.barrier
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_link_libraries(ztd.text.benchmarks.barrier
PRIVATE
ztd::cuneicode
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/conversion_speed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ target_compile_options(ztd.text.benchmarks.conversion_speed
${--warn-default}
${--warn-extra}
${--warn-errors}
${--allow-microsoft-enum-value}
${--allow-alignas-extra-padding}
)
#generate_config_and_manifest_for(ztd.text.benchmarks.conversion_speed)
configure_graph_benchmark_targets(
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/function_form/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target_compile_options(ztd.text.benchmarks.function_form
${--warn-pedantic}
${--warn-all}
${--warn-extra}

${--allow-alignas-extra-padding}
# MSVC is BROKEN
# ${--warn-errors}
)
Expand Down
1 change: 1 addition & 0 deletions examples/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ foreach (example_source_name ${ztd.text.examples.basic.sources})
${--warn-all}
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
)

target_link_libraries(${example_target}
Expand Down
4 changes: 3 additions & 1 deletion examples/boost.text/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ target_compile_options(ztd.text.examples.boost_text
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)

target_include_directories(ztd.text.examples.boost_text
PRIVATE
Expand Down
1 change: 1 addition & 0 deletions examples/documentation/compile_fails/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ foreach (example_name ${ztd.text.examples.documentation.compile_fails.sources})
${--warn-all}
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
)
set_target_properties(${example_target}
PROPERTIES
Expand Down
4 changes: 3 additions & 1 deletion examples/documentation/snippets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ foreach (example_source_name ${ztd.text.examples.documentation.snippets.sources}
${--disable-permissive}
${--warn-pedantic}
${--warn-all}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)

target_link_libraries(${example_target}
PRIVATE
Expand Down
1 change: 1 addition & 0 deletions examples/shift_jis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ target_compile_options(ztd.text.examples.shift_jis
${--warn-all}
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_include_directories(ztd.text.examples.shift_jis
PRIVATE
Expand Down
4 changes: 3 additions & 1 deletion tests/basic_compile_time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ target_compile_options(ztd.text.tests.basic_compile_time
${--warn-errors}
${--template-debugging-mode}
${--extra-constexpr-depth}
${--extra-constexpr-steps})
${--extra-constexpr-steps}
${--allow-alignas-extra-padding}
)
target_include_directories(ztd.text.tests.basic_compile_time
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/include")
Expand Down
7 changes: 5 additions & 2 deletions tests/basic_run_time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ target_compile_options(ztd.text.tests.basic_run_time
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_include_directories(ztd.text.tests.basic_run_time
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/include")
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/include"
)
target_link_libraries(ztd.text.tests.basic_run_time
PRIVATE
ztd::text
Expand Down
4 changes: 3 additions & 1 deletion tests/compile_fails/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ foreach (test_name ${ztd.text.tests.tests.compile_fails.sources})
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_link_libraries(${test_target}
PRIVATE
ztd::text
Expand Down
7 changes: 5 additions & 2 deletions tests/iconv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ target_compile_options(ztd.text.tests.iconv
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_include_directories(ztd.text.tests.iconv
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/include")
"${CMAKE_CURRENT_SOURCE_DIR}/../shared/include"
)
target_link_libraries(ztd.text.tests.iconv
PRIVATE
ztd::text
Expand Down
4 changes: 3 additions & 1 deletion tests/inclusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ target_compile_options(ztd.text.tests.inclusion
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_link_libraries(ztd.text.tests.inclusion
PRIVATE
ztd::text
Expand Down
4 changes: 3 additions & 1 deletion tests/tiny_buffer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ target_compile_options(ztd.text.tests.tiny_buffer
${--warn-pedantic}
${--warn-all}
${--warn-extra}
${--warn-errors})
${--warn-errors}
${--allow-alignas-extra-padding}
)
target_include_directories(ztd.text.tests.tiny_buffer
PRIVATE
include/
Expand Down

0 comments on commit 6d89e5f

Please sign in to comment.