JD2022-TU1/main/extern/UbiServices/custom/_configurations/harbourConfiguration.cmake

280 lines
19 KiB
CMake

# This is a master file that is used by Rendez-vous, Storm and Ubiservices.
# You shouldn't have to edit it more than once for all the products and it should linger for all the products releases.
#######################################################################################################################
# Common platforms configurations
# EAL
# The 'Engine Abstraction Layer (EAL)' is a set of low level C functions which are used by many products libs.
# The EAL API is defined by the EAL comittee, but the game is responsible for providing the implementation of these functions.
# If you don't have an implementation yet, you can temporarely use the default Harbour eal by setting the HARBOUR_BUILD_HARBOUR_EAL value to TRUE.
# Else if you have already have an EAL implementation available, set the path to the include directory within HARBOUR_EAL_INCLUDE_DIRECTORY.
# Use forward slashes for the HARBOUR_EAL_INCLUDE_DIRECTORY value or escape the back slashes with double backslashes.
harbour_set_bool(HARBOUR_BUILD_HARBOUR_EAL "TRUE")
if(NOT HARBOUR_BUILD_HARBOUR_EAL)
harbour_set_path(HARBOUR_EAL_INCLUDE_DIRECTORY "")
endif()
# Blob Support
# For speeding up the compilation, many .cpp files can be bundled in a single 'blob' .cpp file.
# The Harbour products blobs their libraries by default. Set to FALSE, to disable the feature.
harbour_set_bool(HARBOUR_USE_BLOB "TRUE")
#######################################################################################################################
# Library ouput configurations
# Edit here all the options concerning the output format of the libraries and the directory.
# This is the directory where libraries will be outputted. The path can be relative (to /build folder) or absolute.
# Use forward slashes as separator character (.e.g: c:/yourpath) or escape the back slashes with double backslashes (.e.g: c:\\yourpath).
# @Warning : it is not a good practice to use a directory path containing white spaces
harbour_set_path(HARBOUR_LIB_OUTPUT_DIRECTORY "../lib")
#######################################################################################################################
# Sharpmake
#
# Controls Sharpmake interfaces generation for Harbour products.
# HARBOUR_GENERATE_SHARPMAKE_INTERFACES: If this is set to true then build_ubiservices.bat will generate sharpmake interfaces.
# HARBOUR_SHARPMAKE_INTERFACES_OUTPUT_DIRECTORY: The path where the sharpmake interfaces will be found after project generation.
# Platforms supported at the moment: PS4, XONE, PC.
harbour_set_bool(HARBOUR_GENERATE_SHARPMAKE_INTERFACES "FALSE")
if(HARBOUR_GENERATE_SHARPMAKE_INTERFACES)
harbour_set_path(HARBOUR_SHARPMAKE_INTERFACES_OUTPUT_DIRECTORY "D:/JD_CODE_STREAM/main/extern/UbiServices/custom/_sharpmake")
endif()
# Select version of OpenSSL if this value is false the SDK will use the version 1.1.1g, if this value is true the SDK will use the version 1.0.2.
harbour_set_bool(HARBOUR_USE_DEPRECATED_OPENSSL_1_0_2 "FALSE")
# Select version of OpenSSL if this value is false the SDK will use the version 1.1.1g, if this value is true the SDK will use the version 1.1.1k (with QUIC patches).
#
# WARNING: Contrary to previous OpenSSL versions, the latest OpenSSL w/ QUIC support do not define a dummy `getenv` symbol on PlayStation platforms.
# On these platforms, `getenv` does not exist and previous OpenSSL versions shouldn't have defined the symbol as a workaround.
# When linking your executable using Ubiservices, it is possible that other open source static libraries will now report the undefined symbol,
# while previously the linker would have taken the symbol from OpenSSL. Either implement a dummy `getenv` always returning NULL, or ideally,
# patch the open source library to not use `getenv` on these platforms with #ifdef.
harbour_set_bool(HARBOUR_USE_LATEST_OPENSSL_WITH_QUIC_SUPPORT "FALSE")
# Controls how the HARBOUR_LIB_OUTPUT_LAYOUT folder is organized. One of the three follwing layouts can possibly be set:
# HARBOUR_PLATFORMS_TARGETS_SUB_DIRS: Generate subdirectories per platform (win32, win32dll, xenon, etc.) AND per target (Debug, Release, Retail).
# HARBOUR_PLATFORMS_SUB_DIRS: Generate subdirectories per platform but all targets are in the same subdirectory. Target specific suffixes are added to lib filenames.
# HARBOUR_NO_SUB_DIR: Do not generate any subdirectory. Target suffixes are added to the lib files names.
harbour_set(HARBOUR_LIB_OUTPUT_LAYOUT "HARBOUR_PLATFORMS_TARGETS_SUB_DIRS")
# Set if the Visual Studio version (eg.: _2012) is added to the subdirectories name or to the filename suffixes.
harbour_set_bool(HARBOUR_ADD_VS_VERSION_SUFFIX "TRUE")
# When using HARBOUR_PLATFORMS_SUB_DIRS or HARBOUR_NO_SUB_DIR, the following target suffixes are added to the lib files names.
if(HARBOUR_LIB_OUTPUT_LAYOUT STREQUAL "HARBOUR_PLATFORMS_SUB_DIRS" OR HARBOUR_LIB_OUTPUT_LAYOUT STREQUAL "HARBOUR_NO_SUB_DIR")
harbour_set_opt(HARBOUR_SUFFIX_DEBUG "_d") #suffix for the debug libraries
harbour_set_opt(HARBOUR_SUFFIX_RELEASE "_r") #suffix for the release libraries
harbour_set_opt(HARBOUR_SUFFIX_RETAIL "") #suffix for the retail libraries
harbour_set_opt(HARBOUR_SUFFIX_PROFILE "_p") #suffix for the profile libraries
endif()
#######################################################################################################################
# XBoxOne C++11 live sdk
#
# Set here the paths to the xboxLiveSdk Cpp include directories
if(XONE AND XONE_CPP)
harbour_set_path(HARBOUR_XBOXLIVESDKCPP_INCLUDE_DIR "") # Path of the include directory of the xboxLiveSdk (root folder contains "xsapi")
harbour_set_path(HARBOUR_XBOXLIVESDKCPP_CPPRESTSDK_INCLUDE_DIR "") # XboxLiveSdk has a dependency to cppRestSdk, set here the include directory of the cppRestSdk (root folder contains namely "cpprest")
endif()
#######################################################################################################################
# Platform Compilation Flags
# Edit here the compilation flags require for every targeted platforms for all the Harbour products.
# Flags defined in CMAKE_CXX_FLAGS are shared with all C++ targets (DEBUG, RELEASE, etc).
# Flags defined in CMAKE_C_FLAGS are shared with all C targets (DEBUG, RELEASE, etc). These flags are used for C projects such as openSSL or cURL.
#######################################################################################################################
if(WIN) # Configures the Win32/Win64 properties
# This is for Windows Non-Unity. For the Windows Unity version, the flags are set in unity3d.cmake.
harbour_set_bool(HARBOUR_USE_UNICODE "FALSE") # Unicode Support
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "/W4 /WX /EHs-c- /Gy /c /Fp /GR- /GS -D_HAS_EXCEPTIONS=0 -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS /MP2 /wd4702 /bigobj")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG /Z7 /MDd /Od /RTC1 /bigobj")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /Z7 /MD /O2")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /MD /O2")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /MD /O2")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "/W4 /WX /EHs-c- /Gy /c /Fp /GR- /GS -D_HAS_EXCEPTIONS=0 -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS /MP2 /wd4702 /bigobj")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG /Z7 /MDd /Od /RTC1 /bigobj")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /Z7 /MD /O2")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /MD /O2")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /MD /O2")
#######################################################################################################################
elseif(PS4 OR PS5)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-c -fno-rtti -fno-exceptions -Werror")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O2")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -O2")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O2")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-c -fno-rtti -fno-exceptions")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O2")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -O2")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O2")
#######################################################################################################################
elseif(XONE)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-D_UNICODE -DUNICODE /bigobj /nologo /W4 /wd4702 /wd4127 /wd4447 /WX /EHsc /c -D_HAS_EXCEPTIONS=0 /MP")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG /Od /MDd /Z7")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /O2 /MD /Z7")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /O2 /MD")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /O2 /MD")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-D_UNICODE -DUNICODE /bigobj /nologo /W4 /wd4702 /wd4127 /wd4447 /WX /EHsc /c -D_HAS_EXCEPTIONS=0 /MP")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG /Od /MDd /Z7")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /O2 /MD /Z7")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /O2 /MD")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /O2 /MD")
#####################################################################################################################
elseif(OSX)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-MMD -fno-exceptions -fno-rtti -D_OSX -DOSX_LEOPARD -D_GNU_SOURCE -c -Wno-write-strings -Wno-deprecated -std=c++11 -stdlib=libc++")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O3")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -g -O3")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -g -O3")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-MMD -fno-exceptions -fno-rtti -stdlib=libc++ -D_OSX -DOSX_LEOPARD -D_GNU_SOURCE -c -Wno-write-strings -Wno-deprecated")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O3")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -g -O3")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -g -O3")
#####################################################################################################################
elseif(IOS)
# Customize here the C++ compilation flags by build target. Flags defined in CMAKE_CXX_FLAGS are shared with all targets (DEBUG, RELEASE, etc).
# On unity we need to sign the library for archiving because the compiler complains about facade_wrap.cxx not being bitcode signed.
harbour_set (CMAKE_CXX_FLAGS "-stdlib=libc++ -fno-exceptions -fno-rtti -std=c++11 -fembed-bitcode")
harbour_set (CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set (CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -Os -Wl,-dead-strip") # Wl indicates that the flags after are flags for the linker(i.e.: dead-strip)
harbour_set (CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -Os -Wl,-dead-strip")
harbour_set (CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -Os -Wl,-dead-strip")
# Customize here the C compilation flags by build target. Flags defined in CMAKE_C_FLAGS are shared with all targets (DEBUG, RELEASE, etc). These flags are used for C projects such as openSSL or cURL.
harbour_set (CMAKE_C_FLAGS "-stdlib=libc++ -fno-exceptions -fno-rtti -fembed-bitcode")
harbour_set (CMAKE_C_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set (CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -Os -Wl,-dead-strip")
harbour_set (CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -Os -Wl,-dead-strip")
harbour_set (CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -Os -Wl,-dead-strip")
#####################################################################################################################
elseif(TVOS)
# Customize here the C++ compilation flags by build target. Flags defined in CMAKE_CXX_FLAGS are shared with all targets (DEBUG, RELEASE, etc).
# On unity we need to sign the library for archiving because the compiler complains about facade_wrap.cxx not being bitcode signed.
harbour_set (CMAKE_CXX_FLAGS "-stdlib=libc++ -fno-exceptions -fno-rtti -std=c++11 -fembed-bitcode -mtvos-version-min=9.0 -mtvos-simulator-version-min=9.0")
harbour_set (CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set (CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -Os -Wl,-dead-strip") # Wl indicates that the flags after are flags for the linker(i.e.: dead-strip)
harbour_set (CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -Os -Wl,-dead-strip")
harbour_set (CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -Os -Wl,-dead-strip")
# Customize here the C compilation flags by build target. Flags defined in CMAKE_C_FLAGS are shared with all targets (DEBUG, RELEASE, etc). These flags are used for C projects such as openSSL or cURL.
harbour_set (CMAKE_C_FLAGS "-stdlib=libc++ -fno-exceptions -fno-rtti -fembed-bitcode -mtvos-version-min=9.0 -mtvos-simulator-version-min=9.0")
harbour_set (CMAKE_C_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set (CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -Os -Wl,-dead-strip")
harbour_set (CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -Os -Wl,-dead-strip")
harbour_set (CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -Os -Wl,-dead-strip")
#####################################################################################################################
elseif(ANDROID_VS)
# NOTE: Compilation flags for android studio are set with the NDK toolchain.
# C++ compilation flags for build target.
harbour_set (CMAKE_CXX_FLAGS_RETAIL "-O3 -DNDEBUG -DRELEASE -D_RETAIL")
harbour_set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
harbour_set (CMAKE_CXX_FLAGS_DEBUG "-Od -g -DDEBUG -D_DEBUG")
# C compilation flags for build target.
harbour_set (CMAKE_C_FLAGS_RETAIL "-O3 -DNDEBUG -DRELEASE -D_RETAIL")
harbour_set (CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
harbour_set (CMAKE_C_FLAGS_DEBUG "-Od -g -DDEBUG -D_DEBUG")
harbour_set (CMAKE_EXE_LINKER_FLAGS "-Wl,-z,nocopyreloc")
#####################################################################################################################
elseif(LINUX)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-g -O3 -Wall -Wno-sign-compare -mcx16 -msse4 -m64 -Wno-implicit-function-declaration -Wno-return-type -Wno-invalid-offsetof -Wno-overloaded-virtual -fno-exceptions -fno-rtti -std=c++11 -fPIC")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g ")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-g -O3 -Wall -Wno-sign-compare -mcx16 -msse4 -m64 -Wno-implicit-function-declaration -Wno-return-type -Wno-invalid-offsetof -Wno-overloaded-virtual -fno-exceptions -fno-rtti -fPIC")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG")
#####################################################################################################################
elseif(STADIA)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-Wall -Werror -Wno-sign-compare -mcx16 -msse4 -m64 -Wno-implicit-function-declaration -Wno-return-type -Wno-invalid-offsetof -Wno-overloaded-virtual -fno-exceptions -fno-rtti -std=c++11 -fPIC -Use-Multi-Tool-Task")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O3")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -O3")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O3")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-Wall -Werror -Wno-sign-compare -mcx16 -msse4 -m64 -Wno-implicit-function-declaration -Wno-return-type -Wno-invalid-offsetof -Wno-overloaded-virtual -fno-exceptions -fno-rtti -fPIC -Use-Multi-Tool-Task")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -g -O3")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -O3")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O3")
#####################################################################################################################
elseif(SWITCH)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -fno-rtti -fno-exceptions -Wall -Wno-c++11-extensions -Wno-c++11-extra-semi -Wno-c++11-long-long -Werror")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -g")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -DNN_SDK_BUILD_RELEASE -O3")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -DNN_SDK_BUILD_RELEASE -O3")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O3")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing -fno-rtti -fno-exceptions -Wall -Werror")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG -O3")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG -O3")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG -O3")
#######################################################################################################################
elseif(MANJARO)
# C++ compilation flags for build target.
harbour_set(CMAKE_CXX_FLAGS "-D_UNICODE -DUNICODE /bigobj /nologo /W4 /wd4702 /wd4127 /wd4447 /WX /EHsc /c -D_HAS_EXCEPTIONS=0 /MP")
harbour_set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG /Od /MDd /Z7")
harbour_set(CMAKE_CXX_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /O2 /MD /Z7")
harbour_set(CMAKE_CXX_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /O2 /MD")
harbour_set(CMAKE_CXX_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /O2 /MD")
# C compilation flags for build target.
harbour_set(CMAKE_C_FLAGS "-D_UNICODE -DUNICODE /bigobj /nologo /W4 /wd4702 /wd4127 /wd4447 /WX /EHsc /c -D_HAS_EXCEPTIONS=0 /MP")
harbour_set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG /Od /MDd /Z7")
harbour_set(CMAKE_C_FLAGS_RELEASE "-D_RELEASE -DNDEBUG /O2 /MD /Z7")
harbour_set(CMAKE_C_FLAGS_RETAIL "-D_RETAIL -DNDEBUG /O2 /MD")
harbour_set(CMAKE_C_FLAGS_PROFILE "-D_PROFILE -DNDEBUG /O2 /MD")
endif()