diff options
-rw-r--r-- | ldmicro/CMakeLists.txt | 16 | ||||
-rw-r--r-- | ldmicro/lib/linuxUI/linuxUI.h | 3 |
2 files changed, 17 insertions, 2 deletions
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt index 11097c9..7ded52c 100644 --- a/ldmicro/CMakeLists.txt +++ b/ldmicro/CMakeLists.txt @@ -2,6 +2,18 @@ cmake_minimum_required(VERSION 2.6) project(LDMicro) +macro(use_cxx11) + +if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + endif () +else () + set (CMAKE_CXX_STANDARD 11) +endif () + +endmacro(use_cxx11) + IF(WIN32) MESSAGE( FATAL_ERROR "Cannot build for windows, exiting" ) add_definitions(-D__WIN32__) @@ -16,6 +28,8 @@ IF(UNIX) MESSAGE( STATUS "Initializing.." ) add_definitions(-D__UNIX__) add_definitions(-DLDLANG_EN) + use_cxx11() + # set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/build/") MESSAGE( STATUS "Performing system check.." ) @@ -42,7 +56,7 @@ IF(UNIX) add_custom_command( OUTPUT ${OBJDIR}/lang-tables.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/lang-tables.pl > ${OBJDIR}/lang-tables.h + COMMAND perl lang-tables.pl > ${OBJDIR}/lang-tables.h DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lang-*.txt") add_custom_command( diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h index c6bb1ac..09aa981 100644 --- a/ldmicro/lib/linuxUI/linuxUI.h +++ b/ldmicro/lib/linuxUI/linuxUI.h @@ -6,8 +6,9 @@ #include <linux/limits.h> #include <stdio.h> #include <inttypes.h> +#include <string.h> +#include <stdlib.h> #include "linuxLD.h" -//#include "windows.h" /// version control #define LDMicro_VERSION_MAJOR 1 |