Skip to content

Commit 555a574

Browse files
committed
Added support for cmake 'Borland Makefiles'.
* Added BORLAND target to several CMakeLists.txt. (MSVC and BORLAND require similar behaviour for imports/exports) * Added __BORLAND__ ifdefs where needed.
1 parent 82898d7 commit 555a574

File tree

13 files changed

+42
-40
lines changed

13 files changed

+42
-40
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ if(MSVC)
244244
add_definitions( -D__MSVC__ -D__WIN32__ )
245245
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
246246
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
247+
elseif(BORLAND)
248+
add_definitions( -D__BORLAND__ -D__WIN32__ )
247249
else()
248250
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
249251
endif()

data/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
6363
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
6464
COMMENT "Running fedex_plus for ${SCHEMA_SHORT_NAME}..."
6565
VERBATIM )
66-
if(MSVC)
66+
if(MSVC OR BORLAND)
6767
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
6868
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
6969
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
7070
add_definitions( -DSCL_DAI_DLL_IMPORTS )
7171
add_definitions( -DSCL_CORE_DLL_IMPORTS )
7272
add_definitions( -DSCL_EDITOR_DLL_IMPORTS )
73-
endif(MSVC)
73+
endif()
7474
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
7575
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils )
7676
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
@@ -93,11 +93,11 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
9393
set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
9494
set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
9595

96-
if(MSVC)
96+
if(MSVC OR BORLAND)
9797
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
98-
else(MSVC)
98+
else()
9999
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
100-
endif(MSVC)
100+
endif()
101101
add_dependencies( p21read_${PROJECT_NAME} version_string )
102102
target_link_libraries( p21read_${PROJECT_NAME} ${PROJECT_NAME} )
103103
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS

include/express/basic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ typedef int ( *intFuncptr )();
112112
/******************************/
113113

114114
#if !defined(static_inline)
115-
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
115+
#if (!defined(__GNUC__) && !defined(__MSVC__) && !defined(BORLAND)) || defined(__STRICT_ANSI)
116116
#define static_inline
117117
#undef supports_inline_functions
118118
#else
@@ -137,7 +137,7 @@ typedef int ( *intFuncptr )();
137137
# define PROTO(x) x
138138
# else
139139

140-
# if defined(__CLCC__) || defined(__MSVC__)
140+
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
141141
# define PROTO(x) x
142142
#else
143143
# define PROTO(x) ()

include/express/error.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ GLOBAL SCL_EXPRESS_EXPORT void ( *ERRORusage_function ) PROTO( ( void ) );
126126
/* function prototypes */
127127
/***********************/
128128

129-
#ifdef __MSVC__
129+
#if defined(__MSVC__) || defined(__BORLAND__)
130130
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
131131
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
132132
#endif
@@ -162,7 +162,7 @@ ERRORis_enabled( Error error ) {
162162
static_inline
163163
void
164164
ERRORbuffer_messages( bool flag ) {
165-
#ifndef __MSVC__
165+
#if !defined(__MSVC__) && !defined(__BORLAND__)
166166
extern void ERROR_start_message_buffer( void ),
167167
ERROR_flush_message_buffer( void );
168168
#endif
@@ -177,7 +177,7 @@ ERRORbuffer_messages( bool flag ) {
177177
static_inline
178178
void
179179
ERRORflush_messages( void ) {
180-
#ifndef __MSVC__
180+
#if !defined(__MSVC__) && !defined(__BORLAND__)
181181
extern void ERROR_start_message_buffer( void ),
182182
ERROR_flush_message_buffer( void );
183183
#endif
@@ -210,7 +210,7 @@ extern SCL_EXPRESS_EXPORT void ERRORbuffer_messages PROTO( ( bool ) );
210210
extern SCL_EXPRESS_EXPORT void ERRORflush_messages PROTO( ( void ) );
211211
#endif
212212

213-
#ifndef __MSVC__
213+
#if !defined(__MSVC__) && !defined(__BORLAND__)
214214
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
215215
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
216216
#endif

src/cldai/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
2828
sdaiBinary.h
2929
)
3030

31-
IF(MSVC)
31+
IF(MSVC OR BORLAND)
3232
add_definitions( -DSCL_DAI_DLL_EXPORTS )
3333
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
34-
ENDIF(MSVC)
34+
ENDIF()
3535

3636
include_directories(
3737
${CMAKE_CURRENT_SOURCE_DIR}

src/cleditor/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ include_directories(
4040
${SCL_SOURCE_DIR}/src/clutils
4141
)
4242

43-
if(MSVC)
43+
if(MSVC OR BORLAND)
4444
add_definitions( -DSCL_EDITOR_DLL_EXPORTS )
4545
add_definitions( -DSCL_CORE_DLL_IMPORTS )
4646
add_definitions( -DSCL_DAI_DLL_IMPORTS )
4747
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
48-
endif(MSVC)
48+
endif()
4949

5050
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" stepcore stepdai steputils)
5151

src/cleditor/STEPfile.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ STEPfile::ReadHeader( istream & in ) {
7676

7777
InstMgr * im = new InstMgr;
7878
SDAI_Application_instance * obj;
79-
#ifdef __MSVC__
79+
#if defined(__MSVC__) || defined(__BORLAND__)
8080
Severity objsev = SEVERITY_NULL;
8181
#else
8282
__attribute__( ( unused ) ) Severity objsev = SEVERITY_NULL;
@@ -2228,7 +2228,7 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
22282228

22292229
SetFileIdIncrement();
22302230
int total_insts = 0, valid_insts = 0;
2231-
#ifdef __MSVC__
2231+
#if defined(__MSVC__) || defined(__BORLAND__)
22322232
int exchange_file = -1;
22332233
#else
22342234
__attribute__( ( unused ) ) int exchange_file = -1;

src/clstepcore/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ if(MINGW)
3737
)
3838
endif(MINGW)
3939

40-
if(MSVC)
40+
if(MSVC OR BORLAND)
4141
set(LIBDEPEND_SRCS
4242
${SCL_SOURCE_DIR}/src/cleditor/instmgr.cc
4343
${SCL_SOURCE_DIR}/src/cleditor/mgrnode.cc
4444
${SCL_SOURCE_DIR}/src/cleditor/dispnode.cc
4545
${SCL_SOURCE_DIR}/src/cleditor/mgrnodearray.cc
4646
${SCL_SOURCE_DIR}/src/cleditor/needFunc.cc
4747
)
48-
endif(MSVC)
48+
endif()
4949

50-
if(MSVC)
50+
if(MSVC OR BORLAND)
5151
add_definitions( -DSCL_CORE_DLL_EXPORTS )
5252
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
5353
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
5454
add_definitions( -DSCL_DAI_DLL_IMPORTS )
55-
endif(MSVC)
55+
endif()
5656

5757
SET(LIBSTEPCORE_PRIVATE_HDRS
5858
baseType.h

src/clutils/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ include_directories(
2929
${CMAKE_CURRENT_SOURCE_DIR}
3030
)
3131

32-
if (MSVC)
32+
if (MSVC OR BORLAND)
3333
add_definitions( -DSCL_UTILS_DLL_EXPORTS )
34-
endif(MSVC)
34+
endif()
3535

3636
SCL_ADDLIB(steputils "${LIBSTEPUTILS_SRCS}" "")
3737

3838
IF(MINGW)
3939
TARGET_LINK_LIBRARIES(steputils shlwapi.lib)
4040
ENDIF(MINGW)
4141

42-
IF(MSVC)
42+
IF(MSVC OR BORLAND)
4343
TARGET_LINK_LIBRARIES(steputils shlwapi.lib)
44-
ENDIF(MSVC)
44+
ENDIF()
4545

4646
if(APPLE)
4747
set_target_properties(steputils PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")

src/clutils/dirobj.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void DirObj::InsertFile( const char * f, int index ) {
300300
CheckIndex( index );
301301
spot = &fileList[index];
302302
}
303-
#ifdef __WIN32__
303+
#ifdef __MSVC__
304304
char * string = _strdup( f );
305305
#else
306306
char * string = strdup( f );

0 commit comments

Comments
 (0)