Skip to content

Commit

Permalink
Explicitly set the entry point of the unit test executable
Browse files Browse the repository at this point in the history
... otherwise for some reason the msvc linker will not pick up `wmain`, which is provided by the static Catch2 library.
This is important for Windows Unicode builds, e.g. those performed by build environments for the Windows Store such as vcpkg's "x64-uwp" triplet.
  • Loading branch information
trueqbit committed May 18, 2024
1 parent 58a1abc commit 7a034ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ if (MSVC)
# C4458: declaration of 'symbol' hides class member
/wd4458)
endif()
if (CMAKE_CXX_FLAGS MATCHES "/D_UNICODE")
# explicitly set the entry point of the executable file,
# otherwise for some reason the linker will not pick up `wmain`, which is provided by the static Catch2 library
target_link_options(unit_tests PRIVATE "/ENTRY:wmainCRTStartup")
endif()
endif()

target_precompile_headers(unit_tests PRIVATE
Expand Down

0 comments on commit 7a034ca

Please sign in to comment.