why some variables are not set by CLion / CMake ? __GNUC__ etc.

I got libnana.a, but not the test.exe, why?
This commit is contained in:
qPCR4vir 2015-12-03 19:33:19 +01:00
parent 3ad8f5a641
commit 48b622acc7
2 changed files with 31 additions and 17 deletions

View File

@ -38,8 +38,8 @@ endif(WIN32)
#Unicode
option(NANA_UNICODE "Use Unicode Character Set" ON)
if(NANA_UNICODE)
option(USE_UNICODE "Use Unicode Character Set")
if(USE_UNICODE)
add_definitions(-DNANA_UNICODE)
endif()
@ -59,13 +59,19 @@ if(UNIX)
endif()
endif()
if(WIN32)
add_definitions(-DWIN32)
if(MINGW)
add_definitions(-DMINGW)
endif()
endif()
#Find PNG
option(NANA_ENABLE_PNG "Enable the use of PNG" OFF)
option(USE_LIBPNG_FROM_OS "Use libpng from operating system." OFF)
if(NANA_ENABLE_PNG)
option(ENABLE_PNG "Enable the use of PNG")
option(LIBPNG_FROM_OS "Use libpng from operating system.")
if(ENABLE_PNG)
add_definitions(-DNANA_ENABLE_PNG)
if(USE_LIBPNG_FROM_OS)
if(LIBPNG_FROM_OS)
find_package(PNG)
if (PNG_FOUND)
include_directories( ${PNG_INCLUDE_DIRS})
@ -75,11 +81,11 @@ if(NANA_ENABLE_PNG)
endif()
#Find JPEG
option(NANA_ENABLE_JPEG "Enable the use of JPEG" OFF)
option(USE_LIBJPEG_FROM_OS "Use libjpeg from operating system." OFF)
if(NANA_ENABLE_JPEG)
option(ENABLE_JPEG "Enable the use of JPEG")
option(LIBJPEG_FROM_OS "Use libjpeg from operating system.")
if(ENABLE_JPEG)
add_definitions(-DNANA_ENABLE_JPEG)
if(USE_LIBJPEG_FROM_OS)
if(LIBJPEG_FROM_OS)
find_package(JPEG)
if (JPEG_FOUND)
include_directories( ${JPEG_INCLUDE_DIRS})

View File

@ -39,11 +39,12 @@
#endif // _MSVC
// MINGW ...
#if defined(__MINGW32__) || defined(__MINGW64__)
#if defined(__MINGW32__) || defined(__MINGW64__) || defined(MINGW)
#define NANA_MINGW
//#define STD_THREAD_NOT_SUPPORTED // don't works? why? where __GNUC__, etc. are set? by CLion ??
//Use this flag if MinGW version is older than 4.8.1
#if ((__GNUC__ == 4) && ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 2)))
// don't works? why? where __GNUC__, etc. are set? by CLion ??
// ??
#define UNDEFINED_to_string
@ -69,8 +70,8 @@
// Linux:
#elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC)
#define NANA_LINUX 1
#define NANA_X11 1
//#define NANA_LINUX 1
//#define NANA_X11 1
// end Linux
@ -86,9 +87,14 @@
// compilers ...
// temp
//#define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED // don't works?
//#define STD_CODECVT_NOT_SUPPORTED
// GCC ...
#if defined(__GNU__)
#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ <= 1)
// don't works?
//GCC 4.7.0 does not implement the <codecvt> and codecvt_utfx classes ??
#define STD_CODECVT_NOT_SUPPORTED
@ -123,15 +129,17 @@
//#define NANA_ENABLE_JPEG //!
//#define USE_LIBJPEG_FROM_OS // Un-Comment it to use libjpeg from operating system.
#if defined(NANA_ENABLE_JPEG)
#if not defined(USE_LIBJPEG_FROM_OS)
#if not defined(USE_LIBJPEG_FROM_OS)
#define NANA_LIBJPEG
#endif
#endif
//#ifndef NANA_UNICODE
// always define NANA_UNICODE ?? it will be deprecated ?.
#define NANA_UNICODE
#ifndef NANA_UNICODE
#define NANA_UNICODE
#endif
#if defined(NANA_UNICODE) && defined(NANA_WINDOWS)
#ifndef _UNICODE