From 8c314bdaf20847dd7acd5307342a4f333a1ca34d Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Fri, 10 Jan 2025 11:53:00 +0100 Subject: [PATCH] Minor prerequisite changes for Linux compile (#547) --- CMakeLists.txt | 22 ++++++++-------------- CMakePresets.json | 2 +- Extern/CMakeLists.txt | 2 +- Orbitersdk/sample_build/CMakeMain.txt | 2 -- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6197c79cc..75d519717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,21 +32,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ) -if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64-bit build? - set(BUILD64 1) - set(ARCH "x64") - set(PLATFORM_STRING "x64") -else() +if(MSVC AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8) set(BUILD64 0) set(ARCH "x86") - set(PLATFORM_STRING "Win32") - if(MSVC) - add_link_options("/LARGEADDRESSAWARE") - endif() -endif() - -if (NOT ${CMAKE_GENERATOR} STREQUAL "Ninja") - add_compile_options(/MP) + add_link_options("/LARGEADDRESSAWARE") +else() + set(BUILD64 1) + set(ARCH "x64") endif() # Define directories and file paths for some common binaries @@ -96,7 +88,7 @@ set(EXTERN_DIR "${CMAKE_SOURCE_DIR}/Extern") set(HTMLHELP_DIR "${EXTERN_DIR}/Htmlhelp") set(HTMLHELP_INCLUDE_DIR ${HTMLHELP_DIR}/include) set(HTMLHELP_LIB_DIR ${HTMLHELP_DIR}/lib-${ARCH}) -set(HTMLHELP_LIB ${HTMLHELP_LIB_DIR}/Htmlhelp.lib) +set(HTMLHELP_LIB ${HTMLHELP_LIB_DIR}/Htmlhelp.Lib) set(ORBITER_TOOL_MESHC "$") set(ldoc $ ${ORBITER_BINARY_ROOT_DIR}/packages/LDoc/ldoc.lua -v --multimodule) @@ -117,6 +109,8 @@ set(Qt5_x64_DIR if(MSVC) add_compile_options(/we4311 /DNOMINMAX) add_link_options("/NODEFAULTLIB:\"LIBCMTD\"") +else() + set(CMAKE_BUILD_WITH_INSTALL_RPATH true) endif() # Copy data and binary assets from source to binary tree to provide a working Orbiter environment diff --git a/CMakePresets.json b/CMakePresets.json index 0b85aaaed..67f2fd83a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -33,7 +33,7 @@ "cacheVariables": { "CMAKE_C_COMPILER": "winegcc", "CMAKE_CXX_COMPILER": "wineg++", - "ORBITER_MAKE_DOC": "OFF", + "ORBITER_MAKE_DOC": false, "ORBITER_BUILD_D3D9CLIENT": false }, "condition": { diff --git a/Extern/CMakeLists.txt b/Extern/CMakeLists.txt index 04597cd7c..a8690b14e 100644 --- a/Extern/CMakeLists.txt +++ b/Extern/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT DEFINED ORBITER_BINARY_ROOT_DIR) message(FATAL_ERROR "ORBITER_BINARY_ROOT_DIR is not set") endif(NOT DEFINED ORBITER_BINARY_ROOT_DIR) -add_subdirectory(lua) +add_subdirectory(Lua) add_subdirectory(zlib) ## LFS diff --git a/Orbitersdk/sample_build/CMakeMain.txt b/Orbitersdk/sample_build/CMakeMain.txt index 25b8b83bb..43f0cb3fe 100644 --- a/Orbitersdk/sample_build/CMakeMain.txt +++ b/Orbitersdk/sample_build/CMakeMain.txt @@ -25,11 +25,9 @@ set(CMAKE_MODULE_PATH if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64-bit build? set(BUILD64 1) set(ARCH "x64") - set(PLATFORM_STRING "x64") else() set(BUILD64 0) set(ARCH "x86") - set(PLATFORM_STRING "Win32") endif() add_compile_options(/MP)