From 3bd9180e9872681faf62266253cd360964dc3138 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Tue, 3 Dec 2024 11:58:36 -0800 Subject: [PATCH] fix clang --- CMakeLists.txt | 9 +- CMakePresets.json | 209 +++++++++++++++++++----------------- dWorldServer/CMakeLists.txt | 8 +- 3 files changed, 117 insertions(+), 109 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a6c4b23..7afc7cc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,14 @@ if(UNIX) elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now # Also disable non-portable MSVC volatile behavior - add_compile_options("/wd4267" "/utf-8" "/volatile:iso" "/Zc:inline") + add_compile_options("/wd4267" "/utf-8" "/volatile:iso" "/Zc:inline" "/D_CRT_NONSTDC_NO_WARNINGS") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options("-Wno-error=implicit-function-declaration") + add_compile_options("-Wno-error=int-conversion") + add_compile_options("-fno-lto") + add_compile_options("-ferror-limit=0") + MESSAGE(STATUS "HELLO") + endif() elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index c4595ed5..d4894800 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -47,124 +47,131 @@ "hidden": true, "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake" }, + { + "name": "windows-msvc", + "inherits": "default", + "displayName": "[Multi] Windows (MSVC)", + "description": "Set architecture to 64-bit (b/c RakNet)", + "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build/msvc", + "architecture": { + "value": "x64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "intelliSenseMode": "windows-clang-x64" + } + }, + "toolset": "ClangCL" + }, { - "name": "windows-msvc", - "inherits": "default", - "displayName": "[Multi] Windows (MSVC)", - "description": "Set architecture to 64-bit (b/c RakNet)", - "generator": "Visual Studio 17 2022", - "binaryDir": "${sourceDir}/build/msvc", - "architecture": { - "value": "x64" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } + "name": "windows-default", + "inherits": "windows-msvc", + "displayName": "Windows only Configure Settings", + "description": "Sets build and install directories", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "architecture": { + "value": "x64" + } }, { - "name": "windows-default", - "inherits": "windows-msvc", - "displayName": "Windows only Configure Settings", - "description": "Sets build and install directories", - "generator": "Ninja", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "architecture": { - "value": "x64" - } + "name": "linux-config", + "inherits": "default", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } }, { - "name": "linux-config", - "inherits": "default", - "hidden": true, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - } + "name": "linux-clang-debug", + "inherits": [ + "linux-config", + "clang-config", + "debug-config" + ], + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-debug" }, { - "name": "linux-clang-debug", - "inherits": [ - "linux-config", - "clang-config", - "debug-config" - ], - "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", - "description": "Create a debug build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-debug" + "name": "linux-clang-relwithdebinfo", + "inherits": [ + "linux-config", + "clang-config", + "relwithdebinfo-config" + ], + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Create a release build with debug info using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" }, { - "name": "linux-clang-relwithdebinfo", - "inherits": [ - "linux-config", - "clang-config", - "relwithdebinfo-config" - ], - "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", - "description": "Create a release build with debug info using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" + "name": "linux-clang-release", + "inherits": [ + "linux-config", + "clang-config", + "release-config" + ], + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Create a release build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-release" }, { - "name": "linux-clang-release", - "inherits": [ - "linux-config", - "clang-config", - "release-config" - ], - "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", - "description": "Create a release build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-release" + "name": "linux-gnu-debug", + "inherits": [ + "linux-config", + "gnu-config", + "debug-config" + ], + "displayName": "[Debug] Linux (GNU)", + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-debug" }, { - "name": "linux-gnu-debug", - "inherits": [ - "linux-config", - "gnu-config", - "debug-config" - ], - "displayName": "[Debug] Linux (GNU)", - "description": "Create a debug build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-debug" + "name": "linux-gnu-relwithdebinfo", + "inherits": [ + "linux-config", + "gnu-config", + "relwithdebinfo-config" + ], + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Create a release build with debug info using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" }, { - "name": "linux-gnu-relwithdebinfo", - "inherits": [ - "linux-config", - "gnu-config", - "relwithdebinfo-config" - ], - "displayName": "[RelWithDebInfo] Linux (GNU)", - "description": "Create a release build with debug info using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" + "name": "linux-gnu-release", + "inherits": [ + "linux-config", + "gnu-config", + "release-config" + ], + "displayName": "[Release] Linux (GNU)", + "description": "Create a release build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-release" }, { - "name": "linux-gnu-release", - "inherits": [ - "linux-config", - "gnu-config", - "release-config" - ], - "displayName": "[Release] Linux (GNU)", - "description": "Create a release build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-release" - }, - { - "name": "macos", - "inherits": "default", - "displayName": "[Multi] MacOS", - "description": "Create a build for MacOS", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "binaryDir": "${sourceDir}/build/macos" + "name": "macos", + "inherits": "default", + "displayName": "[Multi] MacOS", + "description": "Create a build for MacOS", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "binaryDir": "${sourceDir}/build/macos" } ], "buildPresets": [ diff --git a/dWorldServer/CMakeLists.txt b/dWorldServer/CMakeLists.txt index 62a3767a..8c2295a7 100644 --- a/dWorldServer/CMakeLists.txt +++ b/dWorldServer/CMakeLists.txt @@ -14,10 +14,4 @@ target_include_directories(WorldServer PRIVATE ) target_link_libraries(WorldServer ${COMMON_LIBRARIES} - dScripts - dGameBase - dComponents - dUtilities - dGameMessages - dInventory - dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation dServer) + dScripts dGame dChatFilter dZoneManager dPhysics Detour Recast tinyxml2 dWorldServer dNavigation dServer)