Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start emake release #107

Merged
merged 38 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
124df96
start emake release
Mar 20, 2020
d39c172
build emake
Mar 23, 2020
81c9cb3
merge master
Mar 23, 2020
8d96b91
update submodule
Mar 23, 2020
610fa38
Update ci-build.sh
fundies Mar 23, 2020
435a11a
Update ServerPlugin.cpp
fundies Mar 24, 2020
fbecc6e
Update CMakeLists.txt
fundies Mar 24, 2020
7fd0034
Update CMakeLists.txt
fundies Mar 24, 2020
cadb4a1
Update CMakeLists.txt
fundies Mar 24, 2020
2792f7b
Update ServerPlugin.cpp
fundies Mar 24, 2020
ade17aa
Update ci-build.sh
fundies Mar 24, 2020
d29092f
Update CMakeLists.txt
fundies Mar 24, 2020
d86b543
Append path, not replace it.
RobertBColton Apr 1, 2020
1200733
Actually capture MSYS2 environment.
RobertBColton Apr 1, 2020
1bedc92
oopsie
RobertBColton Apr 1, 2020
68465f7
Actually capture the MSYS2 environment.
RobertBColton Apr 1, 2020
dd94de7
best guess at hack
fundies Apr 1, 2020
82882bb
Update azure-jobs.yml
fundies Apr 1, 2020
289d739
noquote
RobertBColton Apr 2, 2020
f2d1ba0
Update CMakeLists.txt
fundies Apr 3, 2020
fec0ba0
Log QProcess standard output & error
RobertBColton Apr 5, 2020
140fdf3
Update ServerPlugin.cpp
RobertBColton Apr 6, 2020
638b461
Update ServerPlugin.cpp
RobertBColton Apr 6, 2020
05974fb
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
f0f64ff
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
7265a15
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
e200f26
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
f882884
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
5712ff5
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
1c0c3e2
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
1ab7ca0
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
dec11be
Update ServerPlugin.cpp
RobertBColton Apr 7, 2020
4463e12
Update ServerPlugin.cpp
RobertBColton Apr 8, 2020
1e945b4
oopsie
RobertBColton Apr 8, 2020
c055532
use boolean operators
RobertBColton Apr 9, 2020
dc8723e
Use cmake_dependent_option
RobertBColton Apr 9, 2020
1dba8d6
Update CMakeLists.txt
fundies Apr 9, 2020
77d6c85
update submodule
Apr 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 45 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.14)
project(RadialGM)

include(CMakeDependentOption)

option(RGM_ENABLE_GRPC_SERVER "Enable the GRPC client plugin for compilation and code analysis." ON)
option(RGM_BUILD_EMAKE "Build Emake and the compiler." ON)

# FIXME: MSVC dynamic linking requires US TO DLLEXPORT our funcs
# since we currently don't, I'm force disabling the option on MSVC
cmake_dependent_option(RGM_BUILD_STATIC "Build static libs." ON "MSVC" OFF)

if (RGM_BUILD_STATIC)
set(LIB_TYPE STATIC)
else()
set(LIB_TYPE SHARED)
endif()

if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(EXE "RadialGM-Debug")
add_definitions(-DRGM_DEBUG)
else()
set(EXE "RadialGM")
endif()

set(EXE_DESCRIPTION "ENIGMA IDE")

project(RadialGM)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_SKIP_BUILD_RPATH ON)
set(CMAKE_INSTALL_RPATH $ORIGIN)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand All @@ -28,7 +45,7 @@ set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/Dialogs")

# Include ENIGMA things
set(ENIGMA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Submodules/enigma-dev)
include_directories("${CMAKE_BINARY_DIR}/Submodules/enigma-dev/CommandLine/libEGM/libProtocols" "${ENIGMA_DIR}/CommandLine/libEGM")
include_directories("${CMAKE_BINARY_DIR}/Submodules/enigma-dev/shared/protos/" "${ENIGMA_DIR}/CommandLine/libEGM" "${ENIGMA_DIR}/shared")

# Populate a CMake variable with the sources
set(RGM_SOURCES
Expand Down Expand Up @@ -164,9 +181,6 @@ if (RGM_ENABLE_GRPC_SERVER)
set(RGM_HEADERS ${RGM_HEADERS} Plugins/ServerPlugin.h)
endif()


set(CMAKE_INSTALL_RPATH "${ENIGMA_DIR}")

# Tell CMake to create the RadialGM executable
add_executable(${EXE} WIN32 ${RGM_UI} ${RGM_HEADERS} ${RGM_SOURCES} ${EDITOR_SOURCES} ${RGM_RC})

Expand Down Expand Up @@ -240,9 +254,11 @@ find_package(Qt5 COMPONENTS Core Widgets Gui PrintSupport Multimedia REQUIRED)
target_link_libraries(${EXE} PRIVATE Qt5::Core Qt5::Widgets Qt5::Gui Qt5::PrintSupport Qt5::Multimedia)

# LibProto
add_subdirectory(Submodules/enigma-dev/shared)
add_subdirectory(Submodules/enigma-dev/shared/protos)
add_subdirectory(Submodules/enigma-dev/CommandLine/libEGM)
add_dependencies(${EXE} "EGM")
target_link_libraries(${EXE} PRIVATE "EGM" "Protocols")
target_link_libraries(${EXE} PRIVATE "EGM" "Protocols" "ENIGMAShared")

# Find FreeType
find_package(Freetype REQUIRED)
Expand Down Expand Up @@ -270,19 +286,27 @@ if(WIN32)
target_link_libraries(${EXE} PRIVATE Ws2_32 Wtsapi32 Wldap32 Crypt32 Winmm Userenv Netapi32 version Dwmapi Imm32)
endif(WIN32)

install(TARGETS ${EXE} RUNTIME DESTINATION .)

if(MSVC)
# Default MSVC warnings are overkill. Set to Lvl 2
target_compile_options(${EXE} PRIVATE /W1)
target_compile_options("EGM" PRIVATE /W1)
target_compile_options("Protocols" PRIVATE /W1)
# Default MSVC warnings are overkill. Set to Lvl 2
target_compile_options(${EXE} PRIVATE /W1)
endif()

if (RGM_BUILD_EMAKE)
add_subdirectory(Submodules/enigma-dev/CompilerSource)
add_subdirectory(Submodules/enigma-dev/CommandLine/emake)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(CLI_TARGET "emake-debug")
else()
set(CLI_TARGET "emake")
endif()
add_dependencies(${EXE} ${CLI_TARGET})
endif()

install(TARGETS "Protocols" DESTINATION .)
install(TARGETS "EGM" DESTINATION .)
install(TARGETS ${EXE} RUNTIME DESTINATION .)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXE}.dir/Debug/${EXE}.pdb" DESTINATION . OPTIONAL)

set(APPS "${CMAKE_INSTALL_PREFIX}/${EXE}${CMAKE_EXECUTABLE_SUFFIX}")
set(RGM_APP "${CMAKE_INSTALL_PREFIX}/${EXE}${CMAKE_EXECUTABLE_SUFFIX}")
set(EMAKE_APP "${CMAKE_INSTALL_PREFIX}/${CLI_TARGET}${CMAKE_EXECUTABLE_SUFFIX}")

if (MSVC)
file(TO_CMAKE_PATH ${VCPKG_ROOT} VCPKG_ROOT)
Expand All @@ -293,7 +317,8 @@ file(TO_CMAKE_PATH ${VCPKG_ROOT} VCPKG_ROOT)
endif()
else()
set(LIBS "${CMAKE_INSTALL_PREFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}EGM${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${CMAKE_INSTALL_PREFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}Protocols${CMAKE_SHARED_LIBRARY_SUFFIX}")
"${CMAKE_INSTALL_PREFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}Protocols${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${CMAKE_INSTALL_PREFIX}/${CMAKE_SHARED_LIBRARY_PREFIX}ENIGMAShared${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()

if (WIN32)
Expand All @@ -314,7 +339,8 @@ if (WIN32)

install(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${LIBS}\" \"${SEARCH_PATHS}\")
execute_process(COMMAND windeployqt.exe ${WINDEPLOY_ARGS} ${APPS})
fixup_bundle(\"${RGM_APP}\" \"${LIBS}\" \"${SEARCH_PATHS}\")
fixup_bundle(\"${EMAKE_APP}\" \"${LIBS}\" \"${SEARCH_PATHS}\")
execute_process(COMMAND windeployqt.exe ${WINDEPLOY_ARGS} ${RGM_APP})
")
endif()
68 changes: 62 additions & 6 deletions Plugins/ServerPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,31 +242,87 @@ void CompilerClient::UpdateLoop() {
ServerPlugin::ServerPlugin(MainWindow& mainWindow) : RGMPlugin(mainWindow) {
// create a new child process for us to launch an emake server
process = new QProcess(this);

connect(process, &QProcess::errorOccurred, [&](QProcess::ProcessError error) {
qDebug() << "QProcess error: " << error << endl;
});
connect(process, &QProcess::readyReadStandardOutput, [&]() {
emit LogOutput(process->readAllStandardOutput());
});
connect(process, &QProcess::readyReadStandardError, [&]() {
emit LogOutput(process->readAllStandardError());
});

#ifdef _WIN32
//TODO: Make all this stuff configurable in IDE
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();

// FIXME: this is just an approximate guess on how to get emake running outside a msys shell and currently causes emake to crash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertBColton I need your help debugging this. I can just leave it broken for now and have josh merge if you don't want to look now though

QString msysPath;
if (!env.contains("MSYS_ROOT")) {
msysPath = env.value("SystemDrive", "C:") + "/msys64";
qDebug().noquote() << "Environmental variable \"MSYS_ROOT\" is not set defaulting MSYS path to: " + msysPath;
} else msysPath = env.value("MSYS_ROOT");

env.insert("PATH", env.value("PATH") + ";" + msysPath + "/usr/bin;" + msysPath + "/mingw64/bin");
process->setProcessEnvironment(env);
#endif

// look for an executable file that looks like emake in some common directories
QList<QString> searchPaths = {QDir::currentPath(), "./enigma-dev", "../RadialGM/Submodules/enigma-dev"};
QFileInfo emakeFileInfo(QFile("emake"));
QList<QString> searchPaths = {QDir::currentPath(), "./enigma-dev", "../enigma-dev", "../RadialGM/Submodules/enigma-dev"};
#ifndef RGM_DEBUG
QString emakeName = "emake";
#else
QString emakeName = "emake-debug";
#endif

QFileInfo emakeFileInfo;
foreach (auto path, searchPaths) {
const QDir dir(path);
QDir::Filters filters = QDir::Filter::Executable | QDir::Filter::Files;
// we use a wildcard because we want it to find emake.exe on Windows
auto entryList = dir.entryInfoList(QStringList({"emake","emake.exe"}), filters, QDir::SortFlag::NoSort);
auto entryList = dir.entryInfoList(QStringList({emakeName, emakeName + ".exe"}), filters, QDir::SortFlag::NoSort);
if (!entryList.empty()) {
emakeFileInfo = entryList.first();
break;
}
}

if (emakeFileInfo.filePath().isEmpty()) {
qDebug() << "Error: Failed to locate emake. Compiling and syntax check will not work.\n" << "Search Paths:\n" << searchPaths;
return;
}

QFileInfo enigmaFileInfo;
foreach (auto path, searchPaths) {
const QDir dir(path);
QDir::Filters filters = QDir::Filter::AllEntries;
auto entryList = dir.entryInfoList(QStringList({"ENIGMAsystem"}), filters, QDir::SortFlag::NoSort);
if (!entryList.empty()) {
enigmaFileInfo = entryList.first();
break;
}
}

if (enigmaFileInfo.filePath().isEmpty()) {
qDebug() << "Error: Failed to locate ENIGMA sources. Compiling and syntax check will not work.\n" << "Search Paths:\n" << searchPaths;
return;
}

// use the closest matching emake file we found and launch it in a child process
qDebug() << emakeFileInfo.absoluteFilePath();
qDebug() << "Using emake exe at: " << emakeFileInfo.absolutePath();
qDebug() << "Using ENIGMA sources at: " << enigmaFileInfo.absolutePath();
process->setWorkingDirectory(emakeFileInfo.absolutePath());
QString program = emakeFileInfo.fileName();
QStringList arguments;
arguments << "--server"
<< "-e"
<< "Paths"
<< "-r"
<< "--quiet";
<< "--quiet"
<< "--enigma-root"
<< enigmaFileInfo.absolutePath();

qDebug() << "Running: " << program << " " << arguments;

process->start(program, arguments);
process->waitForStarted();
Expand Down
2 changes: 1 addition & 1 deletion Submodules/enigma-dev
Submodule enigma-dev updated 99 files
+1 −1 .travis.yml
+112 −0 CommandLine/emake/CMakeLists.txt
+1 −1 CommandLine/emake/EnigmaCallbacks.cpp
+34 −115 CommandLine/emake/EnigmaPlugin.cpp
+1 −24 CommandLine/emake/EnigmaPlugin.hpp
+15 −9 CommandLine/emake/Main.cpp
+3 −6 CommandLine/emake/Makefile
+8 −1 CommandLine/emake/OptionsParser.cpp
+2 −0 CommandLine/emake/OptionsParser.hpp
+21 −41 CommandLine/libEGM/CMakeLists.txt
+2 −2 CommandLine/libEGM/Makefile
+1 −1 CommandLine/libEGM/gmk.cpp
+3 −2 CommandLine/testing/GitHub-ImageDiff.sh
+43 −0 CompilerSource/CMakeLists.txt
+1 −1 CompilerSource/CompileEGMf.cbp
+1 −1 CompilerSource/JDI/src/API/AST.cpp
+1 −1 CompilerSource/JDI/src/API/context.cpp
+1 −1 CompilerSource/JDI/src/Storage/arg_key.cpp
+1 −1 CompilerSource/JDI/src/Storage/references.cpp
+1 −1 CompilerSource/JDI/src/System/lex_buffer.cpp
+5 −5 CompilerSource/JDI/src/System/lex_cpp.cpp
+5 −5 CompilerSource/JDI/src/System/macros.cpp
+2 −6 CompilerSource/Makefile
+2 −2 CompilerSource/backend/GameData.cpp
+3 −1 CompilerSource/compiler/compile.cpp
+32 −0 CompilerSource/enigma.h
+1 −1 CompilerSource/frontend.cpp
+1 −1 CompilerSource/gcc_interface/gcc_backend.cpp
+1 −1 CompilerSource/languages/lang_CPP.cpp
+14 −7 CompilerSource/main.cpp
+1 −1 CompilerSource/parser/object_storage.cpp
+1 −1 CompilerSource/parser/object_storage.h
+1 −1 CompilerSource/parser/parser.cpp
+1 −1 CompilerSource/parser/parser_components.cpp
+1 −1 CompilerSource/parser/parser_components.h
+5 −5 CompilerSource/settings-parse/crawler.cpp
+4 −2 CompilerSource/settings-parse/parse_ide_settings.cpp
+1 −1 CompilerSource/settings.h
+1 −1 CompilerSource/standalone_main.cpp
+3 −5 ENIGMAsystem/SHELL/Audio_Systems/DirectSound/DSsystem.cpp
+0 −24 ENIGMAsystem/SHELL/Bridges/SDL-Win32/handle.cpp
+1 −4 ENIGMAsystem/SHELL/Bridges/Win32-Direct3D11/graphics_bridge.cpp
+1 −3 ENIGMAsystem/SHELL/Bridges/Win32-Direct3D9/graphics_bridge.cpp
+5 −6 ENIGMAsystem/SHELL/Bridges/Win32/WINDOWShandle.h
+17 −8 ENIGMAsystem/SHELL/Bridges/xlib-OpenGL/graphics_bridge.cpp
+1 −0 ENIGMAsystem/SHELL/Bridges/xlib-OpenGL1/Makefile
+13 −0 ENIGMAsystem/SHELL/Bridges/xlib-OpenGL1/attribs.cpp
+1 −0 ENIGMAsystem/SHELL/Bridges/xlib-OpenGL3/Makefile
+16 −0 ENIGMAsystem/SHELL/Bridges/xlib-OpenGL3/attribs.cpp
+2 −2 ENIGMAsystem/SHELL/Graphics_Systems/OpenGLES3/std.cpp
+0 −2 ENIGMAsystem/SHELL/Makefile
+5 −0 ENIGMAsystem/SHELL/Platforms/General/PFmain.h
+0 −1 ENIGMAsystem/SHELL/Platforms/General/PFwindow.cpp
+4 −7 ENIGMAsystem/SHELL/Platforms/General/PFwindow.h
+39 −18 ENIGMAsystem/SHELL/Platforms/General/POSIX/shell.cpp
+51 −0 ENIGMAsystem/SHELL/Platforms/SDL/Android/Window.cpp
+36 −0 ENIGMAsystem/SHELL/Platforms/SDL/Cocoa/CocoaWindow.m
+62 −0 ENIGMAsystem/SHELL/Platforms/SDL/Cocoa/Window.cpp
+20 −5 ENIGMAsystem/SHELL/Platforms/SDL/Makefile
+62 −0 ENIGMAsystem/SHELL/Platforms/SDL/Win32/Window.cpp
+3 −1 ENIGMAsystem/SHELL/Platforms/SDL/Window.cpp
+1 −0 ENIGMAsystem/SHELL/Platforms/SDL/Window.h
+67 −0 ENIGMAsystem/SHELL/Platforms/SDL/xlib/Window.cpp
+0 −0 ENIGMAsystem/SHELL/Platforms/Win32/WINDOWShandle.cpp
+4 −6 ENIGMAsystem/SHELL/Platforms/Win32/WINDOWSmain.cpp
+13 −7 ENIGMAsystem/SHELL/Platforms/Win32/WINDOWSwindow.cpp
+8 −0 ENIGMAsystem/SHELL/Platforms/platforms_mandatory.h
+1 −1 ENIGMAsystem/SHELL/Platforms/xlib/XLIBicon.cpp
+21 −21 ENIGMAsystem/SHELL/Platforms/xlib/XLIBwindow.cpp
+2 −1 ENIGMAsystem/SHELL/Platforms/xlib/XLIBwindow.h
+1 −1 ENIGMAsystem/SHELL/Universal_System/Extensions/Asynchronous/About.ey
+15 −5 ENIGMAsystem/SHELL/Universal_System/Extensions/FileDropper/FileDropper.cpp
+1 −1 ENIGMAsystem/SHELL/Universal_System/Extensions/RegistrySpoof/registryspoof.cpp
+2 −2 ENIGMAsystem/SHELL/Universal_System/Extensions/libpng/Makefile
+1 −0 ENIGMAsystem/SHELL/Universal_System/Extensions/libpng/libpng-util.cpp
+0 −178 ENIGMAsystem/SHELL/Universal_System/darray.h
+6 −4 ENIGMAsystem/SHELL/Universal_System/image_formats.cpp
+1 −1 ENIGMAsystem/SHELL/Universal_System/image_formats.h
+1 −0 ENIGMAsystem/SHELL/Universal_System/rectpack.cpp
+5 −0 ENIGMAsystem/SHELL/Widget_Systems/GTK+/dialogs.cpp
+35 −5 ENIGMAsystem/SHELL/Widget_Systems/Win32/dialogs.cpp
+3 −5 ENIGMAsystem/SHELL/Widget_Systems/Win32/widgets.cpp
+2 −0 ENIGMAsystem/SHELL/Widget_Systems/widgets_mandatory.h
+4 −7 ENIGMAsystem/SHELL/Widget_Systems/xlib/Info/About.ey
+2 −0 ENIGMAsystem/SHELL/Widget_Systems/xlib/SDL/include.h
+20 −18 ENIGMAsystem/SHELL/Widget_Systems/xlib/kdialog.cpp
+20 −18 ENIGMAsystem/SHELL/Widget_Systems/xlib/zenity.cpp
+17 −12 Makefile
+1 −1 appveyor.yml
+19 −0 azure-pipelines.yml
+32 −0 shared/CMakeLists.txt
+10 −2 shared/Makefile
+0 −0 shared/darray.h
+0 −1 shared/event_reader/Makefile
+1 −1 shared/event_reader/event_parser.cpp
+0 −2 shared/eyaml/Makefile
+0 −9 shared/libpng-util/Makefile
+24 −32 shared/protos/CMakeLists.txt
+0 −1 shared/rectpacker/Makefile