Merge pull request #64 from GabrielRavier/fixMSVCUtf8

Make MSVC recognize source files as UTF-8
This commit is contained in:
Clownacy 2019-10-28 19:00:17 +00:00 committed by GitHub
commit 4e99c97fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -274,6 +274,9 @@ if(MSVC)
target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions
endif() endif()
# Make it so source files are recognized as UTF-8 by MSVC
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
# Build bin2h externally, so it isn't cross-compiled when CSE2 is (Emscripten, cross-GCC, MinGW on Linux, etc.) # Build bin2h externally, so it isn't cross-compiled when CSE2 is (Emscripten, cross-GCC, MinGW on Linux, etc.)
include(ExternalProject) include(ExternalProject)

View file

@ -24,6 +24,9 @@ if(MSVC)
target_compile_definitions(DoConfig PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions target_compile_definitions(DoConfig PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions
endif() endif()
# Make it so source files are recognized as UTF-8 by MSVC
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
# Find FLTK # Find FLTK
if(NOT FORCE_LOCAL_LIBS) if(NOT FORCE_LOCAL_LIBS)
set(FLTK_SKIP_FLUID ON) # Do not require fltk-fluid (the UI designer) set(FLTK_SKIP_FLUID ON) # Do not require fltk-fluid (the UI designer)

View file

@ -19,6 +19,9 @@ if(MSVC)
target_compile_definitions(bin2h PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions target_compile_definitions(bin2h PRIVATE _CRT_SECURE_NO_WARNINGS) # Disable warnings that normally fire up on MSVC when using "unsafe" functions instead of using MSVC's "safe" _s functions
endif() endif()
# Make it so source files are recognized as UTF-8 by MSVC
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
# Enable link-time optimisation if available # Enable link-time optimisation if available
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))