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

View File

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