mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Build: Decouple compiler specific settings from os settings
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-D_BUILD_DIRECTIVE="$<CONFIG>")
|
||||
|
||||
if(PLATFORM EQUAL 32)
|
||||
# Required on 32-bit systems to enable SSE2 (standard on x64)
|
||||
target_compile_options(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-msse2
|
||||
-mfpmath=sse)
|
||||
endif()
|
||||
target_compile_definitions(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-DHAVE_SSE2
|
||||
-D__SSE2__)
|
||||
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
|
||||
|
||||
if(WITH_WARNINGS)
|
||||
target_compile_options(trinity-warning-interface
|
||||
INTERFACE
|
||||
-W
|
||||
-Wall
|
||||
-Wextra
|
||||
-Winit-self
|
||||
-Winvalid-pch
|
||||
-Wfatal-errors
|
||||
-Woverloaded-virtual)
|
||||
|
||||
message(STATUS "GCC: All warnings enabled")
|
||||
endif()
|
||||
|
||||
if(WITH_COREDEBUG)
|
||||
target_compile_options(trinity-compile-option-interface
|
||||
INTERFACE
|
||||
-g3)
|
||||
|
||||
message(STATUS "GCC: Debug-flags set (-g3)")
|
||||
endif()
|
||||
@@ -35,3 +35,13 @@ if(WIN32)
|
||||
elseif(UNIX)
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/platform/unix/settings.cmake")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/compiler/icc/settings.cmake")
|
||||
endif()
|
||||
|
||||
@@ -49,11 +49,3 @@ message(STATUS "UNIX: Detected compiler: ${CMAKE_C_COMPILER}")
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/bin")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/lib")
|
||||
|
||||
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "icc")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/icc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "clang" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
|
||||
endif()
|
||||
|
||||
@@ -6,11 +6,3 @@ add_definitions(-DTRINITY_REQUIRED_WINDOWS_BUILD=18362)
|
||||
|
||||
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
|
||||
elseif(CMAKE_CXX_PLATFORM_ID MATCHES "MinGW")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user