Skip to content

Commit 3cd48c8

Browse files
committed
Define UNICODE/_UNICODE in the CMakeLists.txt.
1 parent 597bcf8 commit 3cd48c8

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

cmake/Common.cmake

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ function(add_our_library target framework_name sources extra_flags link_with)
110110
endif()
111111
endif()
112112

113+
if(WIN32)
114+
set(extra_flags "${extra_flags} -DUNICODE -D_UNICODE")
115+
endif()
116+
113117
if(NOT BUILD_SHARED_LIBS)
114118
set(static_flag "-DALLEGRO_STATICLINK")
115119
endif(NOT BUILD_SHARED_LIBS)
@@ -304,19 +308,26 @@ function(add_our_executable nm)
304308
set_property(TARGET ${nm} APPEND PROPERTY COMPILE_DEFINITIONS ${d})
305309
endforeach()
306310

311+
set(extra_flags "")
312+
307313
if(MSVC)
308314
# Compile with multiple processors
309-
set(msvc_flags "/MP")
315+
set(extra_flags "/MP")
310316
if(WANT_STATIC_RUNTIME)
311317
if(CMAKE_BUILD_TYPE STREQUAL Debug)
312-
set(msvc_flags "${msvc_flags} /MTd")
318+
set(extra_flags "${extra_flags} /MTd")
313319
else()
314-
set(msvc_flags "${msvc_flags} /MT")
320+
set(extra_flags "${extra_flags} /MT")
315321
endif()
316322
endif()
317-
set_target_properties(${nm} PROPERTIES COMPILE_FLAGS "${msvc_flags}")
318323
endif()
319324

325+
if(WIN32)
326+
set(extra_flags "${extra_flags} -DUNICODE -D_UNICODE")
327+
endif()
328+
329+
set_target_properties(${nm} PROPERTIES COMPILE_FLAGS "${extra_flags}")
330+
320331
if(MINGW)
321332
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
322333
set_target_properties(${nm} PROPERTIES LINK_FLAGS "-Wl,-subsystem,windows")

0 commit comments

Comments
 (0)