find_package(Threads REQUIRED)
if(SIMGEAR_HEADLESS)
- message(STATUS "headlesss mode")
+ message(STATUS "headless mode")
set(NO_OPENSCENEGRAPH_INTERFACE 1)
else()
find_package(OpenGL REQUIRED)
if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS -Wall)
+
+ # certain GCC versions don't provide the atomic builds, and hence
+ # require is to provide them in SGAtomic.cxx
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH})
+ check_cxx_source_compiles(
+ "int main() { unsigned mValue; return __sync_add_and_fetch(&mValue, 1); }"
+ GCC_ATOMIC_BUILTINS_FOUND)
endif(CMAKE_COMPILER_IS_GNUCXX)
if(WIN32)
#cmakedefine HAVE_SVN_CLIENT_H
#cmakedefine HAVE_LIBSVN_CLIENT_1
+#cmakedefine GCC_ATOMIC_BUILTINS_FOUND
+
// set if building headless (no OSG or OpenGL libs)
#cmakedefine NO_OPENSCENEGRAPH_INTERFACE
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
+#ifdef HAVE_CONFIG_H
+# include <simgear_config.h>
+#endif
#include "SGAtomic.hxx"
-#if defined(SGATOMIC_USE_GCC4_BUILTINS) && defined (__i386__)
+#if defined(SGATOMIC_USE_GCC4_BUILTINS) && !defined (GCC_ATOMIC_BUILTINS_FOUND)
// Usually the appropriate functions are inlined by gcc.
// But if gcc is called with something equivalent to -march=i386,