From 94442d9ce380fa5154c9e4f7105a6c1943503628 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Mon, 28 Oct 2019 18:22:31 +0100 Subject: [PATCH 1/2] Made it so MSVC interprets source files as UTF-8 to fix compile Signed-off-by: Gabriel Ravier --- CMakeLists.txt | 3 +++ DoConfig/CMakeLists.txt | 3 +++ bin2h/CMakeLists.txt | 3 +++ 3 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f32d235a..e1e6fffc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,6 +270,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 endif() +# Make it so source files are recognized as UTF-8 by MSVC +add_compile_options("$<$:/utf-8>") + # Build bin2h externally, so it isn't cross-compiled when CSE2 is (Emscripten, cross-GCC, MinGW on Linux, etc.) include(ExternalProject) diff --git a/DoConfig/CMakeLists.txt b/DoConfig/CMakeLists.txt index fcf469b9..eb4ff315 100644 --- a/DoConfig/CMakeLists.txt +++ b/DoConfig/CMakeLists.txt @@ -20,6 +20,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 endif() +# Make it so source files are recognized as UTF-8 by MSVC +add_compile_options("$<$:/utf-8>") + # Find FLTK if(NOT FORCE_LOCAL_LIBS) set(FLTK_SKIP_FLUID ON) # Do not require fltk-fluid (the UI designer) diff --git a/bin2h/CMakeLists.txt b/bin2h/CMakeLists.txt index f4dbd025..7f721dc9 100644 --- a/bin2h/CMakeLists.txt +++ b/bin2h/CMakeLists.txt @@ -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 endif() +# Make it so source files are recognized as UTF-8 by MSVC +add_compile_options("$<$:/utf-8>") + # Enable link-time optimisation if available if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) From 2f9f9aaf0f3a6f8f432192787e1fc6ff4b818588 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Mon, 28 Oct 2019 19:21:46 +0100 Subject: [PATCH 2/2] Fix bin2h to use C_COMPILER_ID instead of CXX_COMPILER_ID Signed-off-by: Gabriel Ravier --- bin2h/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin2h/CMakeLists.txt b/bin2h/CMakeLists.txt index 7f721dc9..6f03f5c5 100644 --- a/bin2h/CMakeLists.txt +++ b/bin2h/CMakeLists.txt @@ -20,7 +20,7 @@ if(MSVC) endif() # Make it so source files are recognized as UTF-8 by MSVC -add_compile_options("$<$:/utf-8>") +add_compile_options("$<$:/utf-8>") # Enable link-time optimisation if available if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")