Separate main from lib
This is so that tests can use the logic without having to call in main as well. Furthermore, this way, Qt actually recognises it as a library, and makes it easier to import to tests.
This commit is contained in:
		
							parent
							
								
									b740f5a3cd
								
							
						
					
					
						commit
						7a3f4edf4a
					
				| @ -1,4 +1,7 @@ | ||||
| TEMPLATE = subdirs | ||||
| 
 | ||||
| SUBDIRS += \ | ||||
|   akashi | ||||
|   akashi \ | ||||
|   lib | ||||
| 
 | ||||
| akashi.depends = lib | ||||
|  | ||||
| @ -23,39 +23,12 @@ MOC_DIR = $$PWD/../build | ||||
| 
 | ||||
| RC_ICONS = resource/icon/akashi.ico | ||||
| 
 | ||||
| # Enable this to print network messages tothe console | ||||
| #DEFINES += NET_DEBUG | ||||
| SOURCES += main.cpp | ||||
| 
 | ||||
| SOURCES += src/advertiser.cpp \ | ||||
|     src/aoclient.cpp \ | ||||
|     src/aopacket.cpp \ | ||||
|     src/area_data.cpp \ | ||||
|     src/commands/area.cpp \ | ||||
|     src/commands/authentication.cpp \ | ||||
|     src/commands/casing.cpp \ | ||||
|     src/commands/command_helper.cpp \ | ||||
|     src/commands/messaging.cpp \ | ||||
|     src/commands/moderation.cpp \ | ||||
|     src/commands/music.cpp \ | ||||
|     src/commands/roleplay.cpp \ | ||||
|     src/config_manager.cpp \ | ||||
|     src/db_manager.cpp \ | ||||
|     src/logger.cpp \ | ||||
|     src/main.cpp \ | ||||
|     src/packets.cpp \ | ||||
|     src/server.cpp \ | ||||
|     src/testimony_recorder.cpp \ | ||||
|     src/ws_client.cpp \ | ||||
|     src/ws_proxy.cpp | ||||
| # Include the akashi library | ||||
| win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/release/ -llib | ||||
| else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../lib/debug/ -llib | ||||
| else:unix: LIBS += -L$$OUT_PWD/../lib/ -llib | ||||
| 
 | ||||
| 
 | ||||
| HEADERS += include/advertiser.h \ | ||||
|     include/aoclient.h \ | ||||
|     include/aopacket.h \ | ||||
|     include/area_data.h \ | ||||
|     include/config_manager.h \ | ||||
|     include/db_manager.h \ | ||||
|     include/logger.h \ | ||||
|     include/server.h \ | ||||
|     include/ws_client.h \ | ||||
|     include/ws_proxy.h | ||||
| INCLUDEPATH += $$PWD/../lib | ||||
| DEPENDPATH += $$PWD/../lib | ||||
|  | ||||
| @ -15,9 +15,9 @@ | ||||
| //    You should have received a copy of the GNU Affero General Public License      //
 | ||||
| //    along with this program.  If not, see <https://www.gnu.org/licenses/>.        //
 | ||||
| //////////////////////////////////////////////////////////////////////////////////////
 | ||||
| #include "include/advertiser.h" | ||||
| #include "include/server.h" | ||||
| #include "include/config_manager.h" | ||||
| #include <include/advertiser.h> | ||||
| #include <include/server.h> | ||||
| #include <include/config_manager.h> | ||||
| 
 | ||||
| #include <cstdlib> | ||||
| 
 | ||||
							
								
								
									
										0
									
								
								lib/lib.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								lib/lib.cpp
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										46
									
								
								lib/lib.pro
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								lib/lib.pro
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | ||||
| QT += network websockets core sql | ||||
| QT -= gui | ||||
| 
 | ||||
| TEMPLATE = lib | ||||
| 
 | ||||
| CONFIG += shared c++11 | ||||
| 
 | ||||
| # You can make your code fail to compile if it uses deprecated APIs. | ||||
| # In order to do so, uncomment the following line. | ||||
| #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0 | ||||
| 
 | ||||
| # Enable this to print network messages tothe console | ||||
| #DEFINES += NET_DEBUG | ||||
| 
 | ||||
| SOURCES += \ | ||||
|     src/advertiser.cpp \ | ||||
|     src/aoclient.cpp \ | ||||
|     src/aopacket.cpp \ | ||||
|     src/area_data.cpp \ | ||||
|     src/commands/area.cpp \ | ||||
|     src/commands/authentication.cpp \ | ||||
|     src/commands/casing.cpp \ | ||||
|     src/commands/command_helper.cpp \ | ||||
|     src/commands/messaging.cpp \ | ||||
|     src/commands/moderation.cpp \ | ||||
|     src/commands/music.cpp \ | ||||
|     src/commands/roleplay.cpp \ | ||||
|     src/config_manager.cpp \ | ||||
|     src/db_manager.cpp \ | ||||
|     src/logger.cpp \ | ||||
|     src/packets.cpp \ | ||||
|     src/server.cpp \ | ||||
|     src/testimony_recorder.cpp \ | ||||
|     src/ws_client.cpp \ | ||||
|     src/ws_proxy.cpp | ||||
| 
 | ||||
| HEADERS += include/advertiser.h \ | ||||
|     include/aoclient.h \ | ||||
|     include/aopacket.h \ | ||||
|     include/area_data.h \ | ||||
|     include/config_manager.h \ | ||||
|     include/db_manager.h \ | ||||
|     include/logger.h \ | ||||
|     include/server.h \ | ||||
|     include/ws_client.h \ | ||||
|     include/ws_proxy.h | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Cerapter
						Cerapter