Skip to content

Commit

Permalink
objectcreator: linux makefile (CleverRaven#45575)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei8l authored Nov 24, 2020
1 parent df54339 commit d853602
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 6 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ $(CHKJSON_BIN): $(CHKJSON_SOURCES)
json-check: $(CHKJSON_BIN)
./$(CHKJSON_BIN)

clean: clean-tests
clean: clean-tests clean-object_creator
rm -rf *$(TARGET_NAME) *$(TILES_TARGET_NAME)
rm -rf *$(TILES_TARGET_NAME).exe *$(TARGET_NAME).exe *$(TARGET_NAME).a
rm -rf *obj *objwin
Expand Down Expand Up @@ -1171,6 +1171,12 @@ check: version $(BUILD_PREFIX)cataclysm.a
clean-tests:
$(MAKE) -C tests clean

object_creator: version $(BUILD_PREFIX)cataclysm.a
$(MAKE) -C object_creator

clean-object_creator:
$(MAKE) -C object_creator clean

validate-pr:
ifneq ($(CYGWIN),1)
@build-scripts/validate_pr_in_jenkins
Expand Down
2 changes: 1 addition & 1 deletion msvc-full-features/ObjectCreator-vcpkg-static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4819;4146;26495;26444;26451;4068</DisableSpecificWarnings>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
<AdditionalOptions>/bigobj /utf-8 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj /utf-8 /DQT_STATICPLUGIN %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_CONSOLE;LOCALIZE;USE_VCPKG;QT_NO_KEYWORDS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

<LanguageStandard>stdcpp14</LanguageStandard>
Expand Down
34 changes: 34 additions & 0 deletions object_creator/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PKGCONFIG = pkg-config
QT5_MODULES = Qt5Core Qt5Gui Qt5Widgets
QT5_LIBS = `$(PKGCONFIG) $(QT5_MODULES) --libs`
QT5_CFLAGS = `$(PKGCONFIG) $(QT5_MODULES) --cflags`

SOURCES = $(wildcard *.cpp) messages.cpp format.cpp
VPATH=../src:../tools/format
OBJS = $(sort $(SOURCES:%.cpp=$(ODIR)/%.o))

CATA_LIB=../$(BUILD_PREFIX)cataclysm.a

ODIR ?= obj

CXXFLAGS += $(QT5_CFLAGS) -I../src -I../tools/format -fPIC
LDFLAGS += $(QT5_LIBS)
DEFINES += -DQT_NO_KEYWORDS

object_creator: $(OBJS) $(CATA_LIB)
+$(CXX) -o $@ $(OBJS) $(CATA_LIB) $(CXXFLAGS) $(LDFLAGS)

clean:
rm -f object_creator
rm -rf $(ODIR)

$(shell mkdir -p $(ODIR))

$(ODIR)/%.o: %.cpp
$(CXX) $(CPPFLAGS) $(DEFINES) $(CXXFLAGS) -c ../object_creator/$< -o $@

.PHONY: clean object_creator

.SECONDARY: $(OBJS)

-include ${OBJS:.o=.d}
5 changes: 4 additions & 1 deletion object_creator/creator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#include "worldfactory.h"

#include <QtWidgets/qapplication.h>
#ifdef QT_STATICPLUGIN
#include <QtCore/QtPlugin>

#ifdef _WIN32
Q_IMPORT_PLUGIN( QWindowsIntegrationPlugin );
#endif
#endif

struct MOD_INFORMATION;
using mod_id = string_id<MOD_INFORMATION>;
Expand Down
1 change: 0 additions & 1 deletion object_creator/fake_spell_listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ creator::fake_spell_listbox::fake_spell_listbox( QWidget *parent )
int row = 0;
int col = 0;
int max_row = 0;
int max_col = 0;

QListWidget::resize( QSize( default_text_box_width * 2, default_text_box_height * 4 ) );

Expand Down
2 changes: 1 addition & 1 deletion object_creator/fake_spell_listbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class fake_spell_listbox : public QListWidget
}

void set_spells( const std::vector<fake_spell> &spells );
std::vector<fake_spell> creator::fake_spell_listbox::get_spells() const;
std::vector<fake_spell> get_spells() const;

void setText( const QString &str ) {
id_label.setText( str );
Expand Down
1 change: 0 additions & 1 deletion object_creator/fake_spell_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ creator::fake_spell_window::fake_spell_window( QWidget *parent, Qt::WindowFlags
int row = 0;
int col = 0;
int max_row = 0;
int max_col = 0;

id_label.setParent( this );
id_label.setText( QString( "id" ) );
Expand Down

0 comments on commit d853602

Please sign in to comment.