diff --git a/external/auto_updates/lzma/CMakeLists.txt b/external/auto_updates/lzma/CMakeLists.txt index be81966..2d24284 100644 --- a/external/auto_updates/lzma/CMakeLists.txt +++ b/external/auto_updates/lzma/CMakeLists.txt @@ -12,7 +12,13 @@ INTERFACE ${libs_loc}/lzma/C ) -set(lzma_lib_loc ${libs_loc}/lzma/C/Util/LzmaLib/$,Debug,Release>) +if (build_win64) + set(lzma_platform_dir x64/) +else() + set(lzma_platform_dir "") +endif() + +set(lzma_lib_loc ${libs_loc}/lzma/C/Util/LzmaLib/${lzma_platform_dir}$,Debug,Release>) target_link_libraries(external_lzma INTERFACE diff --git a/external/crash_reports/breakpad/CMakeLists.txt b/external/crash_reports/breakpad/CMakeLists.txt index c09243d..d57a17e 100644 --- a/external/crash_reports/breakpad/CMakeLists.txt +++ b/external/crash_reports/breakpad/CMakeLists.txt @@ -12,7 +12,13 @@ INTERFACE ${libs_loc}/breakpad/src ) -set(breakpad_lib_loc ${libs_loc}/breakpad/src/out/$,Debug,Release>/obj/client) +if (build_win64) + set(breakpad_config_add _x64) +else() + set(breakpad_config_add "") +endif() + +set(breakpad_lib_loc ${libs_loc}/breakpad/src/out/$,Debug${breakpad_config_add},Release${breakpad_config_add}>/obj/client) if (WIN32) target_link_libraries(external_breakpad diff --git a/external/openssl/CMakeLists.txt b/external/openssl/CMakeLists.txt index 8be0cbb..d66b5d8 100644 --- a/external/openssl/CMakeLists.txt +++ b/external/openssl/CMakeLists.txt @@ -9,7 +9,11 @@ add_library(desktop-app::external_openssl ALIAS external_openssl) if (WIN32) set(openssl_lib_ext lib) - set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32) + if (build_win64) + set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out64) + else() + set(openssl_lib_loc ${libs_loc}/openssl_1_1_1/out32) + endif() else() set(openssl_lib_ext a) if (APPLE) diff --git a/external/opus/CMakeLists.txt b/external/opus/CMakeLists.txt index 527902b..71bfd65 100644 --- a/external/opus/CMakeLists.txt +++ b/external/opus/CMakeLists.txt @@ -21,7 +21,12 @@ else() INTERFACE ${libs_loc}/opus/include ) - set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/Win32) + if (build_win64) + set(opus_config_folder x64) + else() + set(opus_config_folder Win32) + endif() + set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/${opus_config_folder}) set_target_properties(external_opus PROPERTIES IMPORTED_LOCATION "${opus_lib_loc}/Release/opus.lib" IMPORTED_LOCATION_DEBUG "${opus_lib_loc}/Debug/opus.lib" diff --git a/external/zlib/CMakeLists.txt b/external/zlib/CMakeLists.txt index 34e4874..f3be3d5 100644 --- a/external/zlib/CMakeLists.txt +++ b/external/zlib/CMakeLists.txt @@ -13,7 +13,12 @@ if (DESKTOP_APP_USE_PACKAGED) elseif (WIN32) target_compile_definitions(external_zlib INTERFACE ZLIB_WINAPI) target_include_directories(external_zlib INTERFACE ${libs_loc}/zlib) - set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/x86/ZlibStat$,Debug,ReleaseWithoutAsm>) + if (build_win64) + set(zlib_config_folder x64) + else() + set(zlib_config_folder x86) + endif() + set(zlib_lib_loc ${libs_loc}/zlib/contrib/vstudio/vc14/${zlib_config_folder}/ZlibStat$,Debug,ReleaseWithoutAsm>) target_link_libraries(external_zlib INTERFACE ${zlib_lib_loc}/zlibstat.lib) elseif (APPLE AND NOT build_osx) target_link_libraries(external_zlib INTERFACE /usr/local/macos/lib/libz.a) diff --git a/options_win.cmake b/options_win.cmake index 4635992..362dd4e 100644 --- a/options_win.cmake +++ b/options_win.cmake @@ -26,6 +26,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") /w15038 # wrong initialization order /w14265 # class has virtual functions, but destructor is not virtual /wd4068 # Disable "warning C4068: unknown pragma" + /wd4267 # 'initializing': conversion from 'size_t' to 'int', possible loss of data. + /wd4244 # '=': conversion from 'size_t' to 'int', possible loss of data. /Zc:wchar_t- # don't tread wchar_t as builtin type /Zi ) @@ -34,6 +36,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") INTERFACE $,/NODEFAULTLIB:LIBCMT,/DEBUG;/OPT:REF> ) + + if (build_win64) + target_compile_options(common_options + INTERFACE + /bigobj # scheme.cpp has too many sections. + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_definitions(common_options INTERFACE diff --git a/run_cmake.py b/run_cmake.py index 8ae7861..20a3c49 100644 --- a/run_cmake.py +++ b/run_cmake.py @@ -12,14 +12,22 @@ def run(project, arguments, buildType=''): basePath = scriptPath + '/../out/' + buildType cmake = ['cmake'] + windowsArch = '' for arg in arguments: if arg == 'debug': cmake.append('-DCMAKE_BUILD_TYPE=Debug') + elif arg == 'x86' or arg == 'x64': + windowsArch = arg elif arg != 'force': cmake.append(arg) - if sys.platform == 'win32': - cmake.append('-AWin32') + if windowsArch == 'x64': + cmake.append('-Ax64') + else: + cmake.append('-AWin32') # default + elif windowsArch != '': + print("[ERROR] x86/x64 switch is supported only on Windows.") + return 1 elif sys.platform == 'darwin': cmake.append('-GXcode') elif buildType: diff --git a/validate_special_target.cmake b/validate_special_target.cmake index c87b135..97f61be 100644 --- a/validate_special_target.cmake +++ b/validate_special_target.cmake @@ -20,7 +20,9 @@ endif() if (WIN32) if (NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp" - AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win") + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64" + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win" + AND NOT DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64") report_bad_special_target() endif() elseif (APPLE) diff --git a/variables.cmake b/variables.cmake index 8bb9aeb..4431fba 100644 --- a/variables.cmake +++ b/variables.cmake @@ -22,6 +22,7 @@ endif() set(disable_autoupdate 0) if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "" OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp" + OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64" OR DESKTOP_APP_SPECIAL_TARGET STREQUAL "macstore") set(disable_autoupdate 1) endif() @@ -57,12 +58,20 @@ endif() set(build_osx 0) set(build_macstore 0) -set(build_winstore 0) +set(build_winstore 0) # 32 or 64 bit set(build_linux32 0) +set(build_win64 0) # normal or uwp +set(build_winstore64 0) if (WIN32) - if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp") + if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "win64") + set(build_win64 1) + elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp") set(build_winstore 1) + elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "uwp64") + set(build_win64 1) + set(build_winstore 1) + set(build_winstore64 1) endif() elseif (APPLE) if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "osx") @@ -90,7 +99,9 @@ else() endif() endif() -if (NOT APPLE OR build_osx) +if (build_win64) + get_filename_component(libs_loc "../Libraries/win64" REALPATH) +elseif (NOT APPLE OR build_osx) get_filename_component(libs_loc "../Libraries" REALPATH) else() get_filename_component(libs_loc "../Libraries/macos" REALPATH)