Skip to content

Commit

Permalink
Minor prerequisite changes for Linux compile (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer authored Jan 10, 2025
1 parent 58674e0 commit 8c314bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
22 changes: 8 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 "$<TARGET_FILE:meshc>")
set(ldoc $<TARGET_FILE:lua::exe> ${ORBITER_BINARY_ROOT_DIR}/packages/LDoc/ldoc.lua -v --multimodule)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion Extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Orbitersdk/sample_build/CMakeMain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8c314bd

Please sign in to comment.