eliminate macro redefine error when used in biicode
This commit is contained in:
parent
9c3f53eab8
commit
79ec3c927d
@ -4,10 +4,8 @@
|
|||||||
# Robert Hauck - Enable support for PNG/Freetype
|
# Robert Hauck - Enable support for PNG/Freetype
|
||||||
# Qiangqiang Wu - Add biicode support
|
# Qiangqiang Wu - Add biicode support
|
||||||
|
|
||||||
if(NOT BIICODE)
|
if(BIICODE)
|
||||||
project(nana)
|
# prepare BII_LIB_SRC
|
||||||
cmake_minimum_required(VERSION 2.8)
|
|
||||||
else()
|
|
||||||
set(LIB_SRC ${BII_LIB_SRC})
|
set(LIB_SRC ${BII_LIB_SRC})
|
||||||
|
|
||||||
foreach(cpp ${BII_LIB_SRC})
|
foreach(cpp ${BII_LIB_SRC})
|
||||||
@ -17,8 +15,32 @@ else()
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
list(REMOVE_ITEM BII_LIB_SRC ${trash_files})
|
list(REMOVE_ITEM BII_LIB_SRC ${trash_files})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
file(GLOB_RECURSE platform_files "*/detail/win32/*")
|
||||||
|
list(APPEND BII_LIB_SRC ${platform_files})
|
||||||
|
elseif(UNIX)
|
||||||
|
file(GLOB_RECURSE platform_files "*/detail/linux_X11/*")
|
||||||
|
list(APPEND BII_LIB_SRC ${platform_files})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Only Windows and Unix are supported for the moment")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# set compile flags
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
||||||
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
|
# we'll use the default config file so we can iliminate the following macro definitions
|
||||||
|
|
||||||
|
add_biicode_targets()
|
||||||
|
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(nana)
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
#Select platform automatically
|
#Select platform automatically
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_definitions(-DNANA_WINDOWS)
|
add_definitions(-DNANA_WINDOWS)
|
||||||
@ -33,21 +55,12 @@ if(WIN32)
|
|||||||
add_definitions(-DSTD_THREAD_NOT_SUPPORTED)
|
add_definitions(-DSTD_THREAD_NOT_SUPPORTED)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BIICODE)
|
|
||||||
file(GLOB_RECURSE platform_files "*/detail/win32/*")
|
|
||||||
list(APPEND BII_LIB_SRC ${platform_files})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
add_definitions(-DNANA_LINUX)
|
add_definitions(-DNANA_LINUX)
|
||||||
add_definitions(-DNANA_X11)
|
add_definitions(-DNANA_X11)
|
||||||
add_definitions(-DPLATFORM_SPEC_HPP=<nana/detail/linux_X11/platform_spec.hpp>)
|
add_definitions(-DPLATFORM_SPEC_HPP=<nana/detail/linux_X11/platform_spec.hpp>)
|
||||||
add_definitions(-DSTD_CODECVT_NOT_SUPPORTED)
|
add_definitions(-DSTD_CODECVT_NOT_SUPPORTED)
|
||||||
if(BIICODE)
|
|
||||||
file(GLOB_RECURSE platform_files "*/detail/linux_X11/*")
|
|
||||||
list(APPEND BII_LIB_SRC ${platform_files})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -75,8 +88,6 @@ if(NANA_UNICODE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(NOT BIICODE)
|
|
||||||
#Find PNG
|
#Find PNG
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
find_package(Freetype)
|
find_package(Freetype)
|
||||||
@ -99,27 +110,17 @@ if(NOT BIICODE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
add_definitions(-DNANA_ENABLE_PNG)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#Copy our new config.hpp (with removed defines)
|
#Copy our new config.hpp (with removed defines)
|
||||||
if(NOT BIICODE)
|
|
||||||
# I don't know how it works!!!
|
|
||||||
message("Check config.hpp and copy")
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND}
|
execute_process(COMMAND ${CMAKE_COMMAND}
|
||||||
-E copy_if_different
|
-E copy_if_different
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.hpp
|
${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.hpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include/nana/)
|
${CMAKE_CURRENT_SOURCE_DIR}/include/nana/)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
if(BIICODE)
|
|
||||||
add_biicode_targets()
|
|
||||||
else()
|
|
||||||
set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
|
set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source)
|
||||||
set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
|
set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
@ -155,4 +156,3 @@ else()
|
|||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib)
|
LIBRARY DESTINATION lib)
|
||||||
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
|
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
|
||||||
endif()
|
|
||||||
@ -23,7 +23,6 @@
|
|||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#define NANA_MINGW
|
#define NANA_MINGW
|
||||||
#define STD_CODECVT_NOT_SUPPORTED
|
#define STD_CODECVT_NOT_SUPPORTED
|
||||||
//#define STD_THREAD_NOT_SUPPORTED //Use this flag if MinGW version is older than 4.8.1
|
|
||||||
#endif
|
#endif
|
||||||
#elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
|
#elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
|
||||||
//Linux:
|
//Linux:
|
||||||
@ -31,13 +30,29 @@
|
|||||||
#define NANA_X11 1
|
#define NANA_X11 1
|
||||||
#define PLATFORM_SPEC_HPP <nana/detail/linux_X11/platform_spec.hpp>
|
#define PLATFORM_SPEC_HPP <nana/detail/linux_X11/platform_spec.hpp>
|
||||||
#define STD_CODECVT_NOT_SUPPORTED
|
#define STD_CODECVT_NOT_SUPPORTED
|
||||||
|
#else
|
||||||
|
# error "Only Windows and Unix are support now"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// C++11 detection
|
||||||
|
#if defined(__GNUC_MINOR__)
|
||||||
|
# if __GNUC_MINOR__ < 8
|
||||||
|
# define NANA_NO_CPP11
|
||||||
|
# endif
|
||||||
|
#elif _MSC_VER < 1700
|
||||||
|
# define NANA_NO_CPP11
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(NANA_NO_CPP11)
|
||||||
|
# define STD_THREAD_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Here defines some flags that tell Nana what features will be supported.
|
//Here defines some flags that tell Nana what features will be supported.
|
||||||
|
|
||||||
#define NANA_UNICODE
|
#define NANA_ENABLE_PNG
|
||||||
|
#define NANA_UNICODE // always use unicode, don't make users confusing!
|
||||||
|
|
||||||
#if defined(NANA_UNICODE) && defined(NANA_WINDOWS)
|
#if defined(NANA_WINDOWS)
|
||||||
#ifndef _UNICODE
|
#ifndef _UNICODE
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
#endif
|
#endif
|
||||||
@ -47,13 +62,4 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Support for PNG
|
|
||||||
// Comment it to disable the feature of support for PNG.
|
|
||||||
//#define NANA_ENABLE_PNG
|
|
||||||
#if defined(NANA_ENABLE_PNG)
|
|
||||||
//Comment it to use libpng from operating system.
|
|
||||||
#define NANA_LIBPNG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif //NANA_CONFIG_HPP
|
#endif //NANA_CONFIG_HPP
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Implement workarounds for MinGW
|
//Implement workarounds for MinGW
|
||||||
#if defined(NANA_MINGW) && __GNUC_MINOR__ < 8
|
#if NANA_NO_CPP11
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
//Workaround for no implemenation of std::stoi in MinGW.
|
//Workaround for no implemenation of std::stoi in MinGW.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define NANA_STD_CONDITION_VARIABLE_HPP
|
#define NANA_STD_CONDITION_VARIABLE_HPP
|
||||||
#include <nana/config.hpp>
|
#include <nana/config.hpp>
|
||||||
|
|
||||||
#if defined(STD_THREAD_NOT_SUPPORTED) && !defined(NANA_MINGW) || __GNUC_MINOR__ < 8
|
#if NANA_NO_CPP11
|
||||||
|
|
||||||
#include <boost/thread/condition_variable.hpp>
|
#include <boost/thread/condition_variable.hpp>
|
||||||
namespace std
|
namespace std
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define NANA_STD_MUTEX_HPP
|
#define NANA_STD_MUTEX_HPP
|
||||||
#include <nana/config.hpp>
|
#include <nana/config.hpp>
|
||||||
|
|
||||||
#if defined(STD_THREAD_NOT_SUPPORTED) && !defined(NANA_MINGW) || __GNUC_MINOR__ < 8
|
#if NANA_NO_CPP11
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/recursive_mutex.hpp>
|
#include <boost/thread/recursive_mutex.hpp>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define NANA_STD_THREAD_HPP
|
#define NANA_STD_THREAD_HPP
|
||||||
#include <nana/config.hpp>
|
#include <nana/config.hpp>
|
||||||
|
|
||||||
#if defined(STD_THREAD_NOT_SUPPORTED) && !defined(NANA_MINGW) || __GNUC_MINOR__ < 8
|
#if NANA_NO_CPP11
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include PLATFORM_SPEC_HPP
|
#include PLATFORM_SPEC_HPP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NANA_MINGW) && __GNUC_MINOR__ < 8
|
#if NANA_NO_CPP11
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user