Back to home page

Enduro/X

 
 

    


0001 ##
0002 ## @brief Basic Call Testing
0003 ##
0004 ## @file CMakeLists.txt
0005 ##
0006 ## -----------------------------------------------------------------------------
0007 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0008 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009 ## Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012 ## See LICENSE file for full text.
0013 ## -----------------------------------------------------------------------------
0014 ## AGPL license:
0015 ##
0016 ## This program is free software; you can redistribute it and/or modify it under
0017 ## the terms of the GNU Affero General Public License, version 3 as published
0018 ## by the Free Software Foundation;
0019 ##
0020 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022 ## PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0023 ## for more details.
0024 ##
0025 ## You should have received a copy of the GNU Affero General Public License along 
0026 ## with this program; if not, write to the Free Software Foundation, Inc.,
0027 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028 ##
0029 ## -----------------------------------------------------------------------------
0030 ## A commercial use license is available from Mavimax, Ltd
0031 ## contact@mavimax.com
0032 ## -----------------------------------------------------------------------------
0033 ##
0034 cmake_minimum_required(VERSION 3.5)
0035 
0036 # Make sure the compiler can find include files from UBF library
0037 include_directories (${ENDUROX_SOURCE_DIR}/libubf
0038                                          ${ENDUROX_SOURCE_DIR}/include
0039                                          ${ENDUROX_SOURCE_DIR}/libnstd
0040                                          ${ENDUROX_SOURCE_DIR}/ubftest)
0041 
0042 
0043 # Add debug options
0044 # By default if RELEASE_BUILD is not defined, then we run in debug!
0045 IF (ENV{RELEASE_BUILD})
0046         # do nothing
0047 ELSE (ENV{RELEASE_BUILD})
0048         ADD_DEFINITIONS("-D NDRX_DEBUG")
0049 ENDIF (ENV{RELEASE_BUILD})
0050 
0051 # Make sure the linker can find the UBF library once it is built.
0052 link_directories (${ENDUROX_BINARY_DIR}/libubf) 
0053 
0054 ############################# Test - executables ###############################
0055 add_executable (atmi.sv21 atmisv21.c ../../libatmisrv/rawmain_integra.c)
0056 add_executable (atmiclt21 atmiclt21.c)
0057 add_executable (atmiclt21-105 atmiclt21-105.c)
0058 add_executable (atmiclt21-try atmiclt21-try.c)
0059 add_executable (atmiclt21-startfail atmiclt21-startfail.c)
0060 add_executable (atmiclt21-tpconvert atmiclt21-tpconvert.c)
0061 add_executable (atmiclt21tx atmiclt21tx.c)
0062 
0063 # Conversations
0064 add_executable (convsv21 convsv21.c ../../libatmisrv/rawmain_integra.c)
0065 add_executable (convclt21 convclt21.c)
0066 
0067 # shell testing
0068 add_executable (atmiclt21-cli atmiclt21-cli.c)
0069 
0070 # Oapi tests
0071 add_executable (atmiclt21-oapi atmiclt21-oapi.c)
0072 ################################################################################
0073 ############################# Test - executables ###############################
0074 # Link the executable to the ATMI library & others...
0075 target_link_libraries (atmi.sv21 atmisrvinteg atmi ubf nstd  ${RT_LIB} xadrv pthread m)
0076 target_link_libraries (atmiclt21 atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0077 target_link_libraries (atmiclt21-105 atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0078 target_link_libraries (atmiclt21-try atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0079 target_link_libraries (atmiclt21-startfail atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0080 target_link_libraries (atmiclt21-tpconvert atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0081 target_link_libraries (atmiclt21tx atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0082 
0083 # Conversations test
0084 target_link_libraries (convsv21 atmisrvinteg atmi ubf nstd  ${RT_LIB} xadrv pthread m)
0085 target_link_libraries (convclt21 atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0086 
0087 # shell testing
0088 target_link_libraries (atmiclt21-cli atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0089 
0090 # oapi testing
0091 target_link_libraries (atmiclt21-oapi atmiclt atmi ubf nstd ${RT_LIB} xadrv pthread m)
0092 
0093 set_target_properties(atmi.sv21 PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0094 set_target_properties(atmiclt21 PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0095 set_target_properties(atmiclt21-105 PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0096 set_target_properties(atmiclt21-startfail PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0097 set_target_properties(atmiclt21-tpconvert PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0098 set_target_properties(atmiclt21tx PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0099 
0100 # Conversation test
0101 set_target_properties(convsv21 PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0102 set_target_properties(convclt21 PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0103 
0104 # shell testing
0105 set_target_properties(atmiclt21-cli PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0106 
0107 # Oapi tests
0108 set_target_properties(atmiclt21-oapi PROPERTIES LINK_FLAGS "$ENV{MYLDFLAGS}")
0109 
0110 
0111 add_library (xadrv SHARED
0112                 xabackend.c
0113             )
0114 
0115 add_library (xadrv_s SHARED
0116                 xabackend_s.c
0117                 xabackend_common.c
0118             )
0119 
0120 add_library (xadrv_s-105 SHARED
0121                 xabackend_s-105.c
0122                 xabackend_common.c
0123             )
0124 
0125 
0126 add_library (xadrv_s-tryok SHARED
0127                 xabackend_s-tryok.c
0128                 xabackend_common.c
0129             )
0130 
0131 add_library (xadrv_s-tryfail SHARED
0132                 xabackend_s-tryfail.c
0133                 xabackend_common.c
0134              )
0135              
0136 add_library (xadrv_s-startfail SHARED
0137                 xabackend_s-startfail.c
0138                 xabackend_common.c
0139             )
0140 
0141 add_library (xadrv_d SHARED
0142                 xabackend_d.c
0143                 xabackend_common.c
0144             )
0145 
0146 
0147 if(CMAKE_OS_NAME STREQUAL "CYGWIN")
0148     target_link_libraries(xadrv atmi ubf nstd)
0149     target_link_libraries(xadrv_s atmi ubf nstd)
0150     target_link_libraries(xadrv_s-105 atmi ubf nstd)
0151     target_link_libraries(xadrv_s-tryok atmi ubf nstd)
0152     target_link_libraries(xadrv_s-tryfail atmi ubf nstd)
0153     target_link_libraries(xadrv_s-startfail atmi ubf nstd)
0154     target_link_libraries(xadrv_d atmi ubf nstd)
0155 elseif(CMAKE_OS_NAME STREQUAL "DARWIN")
0156     target_link_libraries(xadrv atmi ubf nstd)
0157     target_link_libraries(xadrv_s atmi ubf nstd)
0158     target_link_libraries(xadrv_s-105 atmi ubf nstd)
0159     target_link_libraries(xadrv_s-tryok atmi ubf nstd)
0160     target_link_libraries(xadrv_s-tryfail atmi ubf nstd)
0161     target_link_libraries(xadrv_s-startfail atmi ubf nstd)
0162     target_link_libraries(xadrv_d atmi ubf nstd)
0163 elseif(CMAKE_OS_NAME STREQUAL "AIX")
0164     # Fixes on TLS issues: Bug #228 __tls_get_addr:..
0165     target_link_libraries(xadrv pthread)
0166     target_link_libraries(xadrv_s pthread)
0167     target_link_libraries(xadrv_s-105 pthread)
0168     target_link_libraries(xadrv_s-tryok pthread)
0169     target_link_libraries(xadrv_s-tryfail pthread)
0170     target_link_libraries(xadrv_s-startfail pthread)
0171     target_link_libraries(xadrv_d pthread)
0172 endif()
0173 ################################################################################
0174 # vim: set ts=4 sw=4 et smartindent: