Cleanup CMake rules:

+ Add the option for building with hidden visibility.
+ Use the result of long files support tests instead of hard-coded definition.
+ Add the presence test TDEIO::UDS_HIDDEN.
+ Remove unnecessary tests.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/6/head r14.1.0
Slávek Banko 1 year ago
parent fcd778d34c
commit b1a3fa8599
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -45,6 +45,12 @@ include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
##### user requested modules ####################
option( BUILD_ALL "Build all" OFF )
@ -59,10 +65,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings #################
add_definitions(
-DHAVE_CONFIG_H
-D_LARGEFILE64_SOURCE
)
add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

@ -29,11 +29,18 @@ if( WITH_GCC_VISIBILITY )
endif( WITH_GCC_VISIBILITY )
check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
check_include_file( stdint.h HAVE_STDINT_H )
check_include_file( systems.h HAVE_SYSTEMS_H )
check_include_file( linux/inotify.h HAVE_INOTIFY )
check_function_exists( statvfs HAVE_STATVFS )
##### check for TDEIO::UDS_HIDDEN
tde_save_and_set( CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} ${TDE_INCLUDE_DIR} )
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES tdeio-shared )
check_cxx_source_compiles( "
#include <tdeio/global.h>
int main()
{
int val = TDEIO::UDS_HIDDEN;
return 1;
}"
HAVE_UDS_HIDDEN
)
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )

@ -1,5 +1,10 @@
#cmakedefine SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_SYSTEMS_H 1
#cmakedefine HAVE_STATVFS 1
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
#cmakedefine HAVE_UDS_HIDDEN 1

Loading…
Cancel
Save