Commit 2cda6f4b authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

early work on DLL exports for sweet lib, stop using <cstdio> which mingw seems...

early work on DLL exports for sweet lib, stop using <cstdio> which mingw seems not to like cuz snprintf()
parent 77c64161
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -50,7 +50,10 @@ macro(perform_feature_checks)
    #        mean won't fail somewhere down the line.
    #        mean won't fail somewhere down the line.
    check_include_file("iso646.h" HAVE_ISO646_H)
    check_include_file("iso646.h" HAVE_ISO646_H)


    check_include_file("strings.h" HAVE_STRINGS_H)
    # no place is this used, and "HAVE_STRINGS_H", if present in config.h then
    # conflicts with /usr/include/python2.6/Python.h.  Please rename the macro if
    # re-introduce this.
    # check_include_file("strings.h" HAVE_STRINGS_H)


    include(CheckSymbolExists)
    include(CheckSymbolExists)
    check_symbol_exists(strcasecmp "string.h" HAVE_STRCASECMP)
    check_symbol_exists(strcasecmp "string.h" HAVE_STRCASECMP)
@@ -68,7 +71,7 @@ macro(perform_feature_checks)
    check_symbol_exists(_hypot "math.h" HAVE_ISO_HYPOT)
    check_symbol_exists(_hypot "math.h" HAVE_ISO_HYPOT)


    # Generate config.h.
    # Generate config.h.
    configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
    configure_file(${PROJECT_SOURCE_DIR}/CMakeModules/config.h.cmake
                   ${CMAKE_BINARY_DIR}/config.h)
                   ${CMAKE_BINARY_DIR}/config.h)


endmacro(perform_feature_checks)
endmacro(perform_feature_checks)
+0 −2
Original line number Original line Diff line number Diff line
@@ -35,8 +35,6 @@
#include <iso646.h>
#include <iso646.h>
#endif
#endif


#cmakedefine HAVE_STRINGS_H

#if defined( HAVE_STRCASECMP )
#if defined( HAVE_STRCASECMP )
#define stricmp strcasecmp
#define stricmp strcasecmp
#elif defined( HAVE_ISO_STRICMP )
#elif defined( HAVE_ISO_STRICMP )
+1 −1
Original line number Original line Diff line number Diff line
@@ -25,7 +25,7 @@
#ifndef DSNLEXER_H_
#ifndef DSNLEXER_H_
#define DSNLEXER_H_
#define DSNLEXER_H_


#include <cstdio>
#include <stdio.h>
#include <string>
#include <string>
#include <vector>
#include <vector>


+2 −2
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@
// I really did not want to be dependent on wxWidgets in richio
// I really did not want to be dependent on wxWidgets in richio
// but the errorText needs to be wide char so wxString rules.
// but the errorText needs to be wide char so wxString rules.
#include <wx/wx.h>
#include <wx/wx.h>
#include <cstdio>
#include <stdio.h>




/**
/**
@@ -56,7 +56,7 @@


// use one of the following __LOC__ defs, depending on whether your
// use one of the following __LOC__ defs, depending on whether your
// compiler supports __func__ or not, and how it handles __LINE__
// compiler supports __func__ or not, and how it handles __LINE__
#define __LOC__         ((std::string(__func__) + " : ") + TOSTRING(__LINE__)).c_str()
#define __LOC__         ((std::string(__func__) + "() : line ") + TOSTRING(__LINE__)).c_str()
//#define __LOC__         TOSTRING(__LINE__)
//#define __LOC__         TOSTRING(__LINE__)


/// macro which captures the "call site" values of __FILE_ & __LOC__
/// macro which captures the "call site" values of __FILE_ & __LOC__
+17 −1
Original line number Original line Diff line number Diff line
@@ -24,6 +24,10 @@ if( STAND_ALONE )


    check_find_package_result( wxWidgets_FOUND "wxWidgets" )
    check_find_package_result( wxWidgets_FOUND "wxWidgets" )


    # make config.h
    include(PerformFeatureChecks)
    perform_feature_checks()

    # Include wxWidgets macros.
    # Include wxWidgets macros.
    include( ${wxWidgets_USE_FILE} )
    include( ${wxWidgets_USE_FILE} )


@@ -59,6 +63,7 @@ endif()




include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_BINARY_DIR} )


#=====<on standby for possible C++ unit testing>================================
#=====<on standby for possible C++ unit testing>================================
if( false )
if( false )
@@ -95,6 +100,7 @@ make_lexer(
    PR
    PR
    )
    )



add_library( sweet SHARED
add_library( sweet SHARED
    sch_lib_table.cpp
    sch_lib_table.cpp
    sch_lib_table_keywords.cpp
    sch_lib_table_keywords.cpp
@@ -108,7 +114,17 @@ add_library( sweet SHARED
    )
    )
target_link_libraries( sweet ${wxWidgets_LIBRARIES} )
target_link_libraries( sweet ${wxWidgets_LIBRARIES} )


# talk to import_export.h
set_target_properties( sweet PROPERTIES
    DEFINE_SYMBOL COMPILING_DLL
    )

add_executable( test_sch_lib_table test_sch_lib_table.cpp )
add_executable( test_sch_lib_table test_sch_lib_table.cpp )
if( MINGW )
    set_target_properties( test_sch_lib_table PROPERTIES
        LINK_FLAGS -Wl,--enable-auto-import
    )
endif()
target_link_libraries( test_sch_lib_table sweet )
target_link_libraries( test_sch_lib_table sweet )




@@ -116,7 +132,7 @@ target_link_libraries( test_sch_lib_table sweet )
# if you want a Python scripting layer on top for unit testing or driving.
# if you want a Python scripting layer on top for unit testing or driving.
# reference: http://www.swig.org/Doc1.3/Introduction.html#Introduction_build_system
# reference: http://www.swig.org/Doc1.3/Introduction.html#Introduction_build_system


option( USE_SWIG "Use SWIG to build a python scripting interface (default ON)." ON)
option( USE_SWIG "Use SWIG to build a python scripting interface (default OFF)." OFF)
if( USE_SWIG )
if( USE_SWIG )


    find_package( SWIG REQUIRED )
    find_package( SWIG REQUIRED )
Loading