forked from Mirrors/openclonk
Fix linux CMake build
Not tested: Cross compiling, might need to be implemented into CMakeLists
parent
21d714bb93
commit
14e8d4794d
|
@ -326,8 +326,6 @@ add_executable(clonk WIN32 MACOSX_BUNDLE
|
||||||
|
|
||||||
add_executable(c4group
|
add_executable(c4group
|
||||||
group/c4group_ng.cpp
|
group/c4group_ng.cpp
|
||||||
engine/src/C4Config.cpp
|
|
||||||
engine/sec/C4ConfigShareware.cpp
|
|
||||||
engine/src/C4Group.cpp
|
engine/src/C4Group.cpp
|
||||||
engine/src/C4InputValidation.cpp
|
engine/src/C4InputValidation.cpp
|
||||||
engine/sec/C4SecurityCertificates.cpp
|
engine/sec/C4SecurityCertificates.cpp
|
||||||
|
@ -606,6 +604,17 @@ target_link_libraries(c4group
|
||||||
${OPENSSL}
|
${OPENSSL}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" USE_GCC_STD_0X)
|
||||||
|
if(USE_GCC_STD_0X)
|
||||||
|
list(APPEND OC_CXX_FLAGS "-std=gnu++0x")
|
||||||
|
endif()
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${OC_CXX_FLAGS})
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("void f(struct D&&); int main() { return 0; }" HAVE_RVALUE_REF)
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
add_definitions(-DHAVE_CONFIG_H)
|
add_definitions(-DHAVE_CONFIG_H)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OC_CXX_FLAGS}" CACHE STRING "C++ compiler flags" FORCE)
|
||||||
|
|
||||||
|
|
|
@ -178,3 +178,7 @@
|
||||||
|
|
||||||
/* compile with debug options */
|
/* compile with debug options */
|
||||||
#cmakedefine _DEBUG
|
#cmakedefine _DEBUG
|
||||||
|
|
||||||
|
/* Define to 1 if rvalue references are supported */
|
||||||
|
#cmakedefine HAVE_RVALUE_REF
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ BOOL C4Config::Load(BOOL forceWorkingDirectory, const char *szConfigFile)
|
||||||
StdStrBuf filename(getenv("HOME"));
|
StdStrBuf filename(getenv("HOME"));
|
||||||
if (filename) { filename += "/"; }
|
if (filename) { filename += "/"; }
|
||||||
filename += ".clonk/" C4ENGINENICK;
|
filename += ".clonk/" C4ENGINENICK;
|
||||||
CreateDirectory(filename.getData());
|
CreatePath(filename.getData());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Buggy StdCompiler crashes when compiling a Null-StdStrBuf
|
// Buggy StdCompiler crashes when compiling a Null-StdStrBuf
|
||||||
|
|
|
@ -104,11 +104,6 @@ typedef __int32 intptr_t;
|
||||||
#define ALLOW_TEMP_TO_REF(ClassName)
|
#define ALLOW_TEMP_TO_REF(ClassName)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
|
||||||
// Another temporary-to-reference-fix: this time using C++0x's rvalue references
|
|
||||||
#define HAVE_RVALUE_REF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_RVALUE_REF
|
#ifdef HAVE_RVALUE_REF
|
||||||
# define RREF &&
|
# define RREF &&
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue