Skip to content

Commit

Permalink
Merge pull request #183 from OldFoolAgain/worflow
Browse files Browse the repository at this point in the history
Workflow
  • Loading branch information
strattond committed Aug 24, 2023
2 parents fb64e87 + 3140baa commit cf13a1c
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 81 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: UOX3 Build

on:
push:

paths-ignore:
- '**.js'
- '**.dfn'
- '**.scp'
- '**.txt'
- '**.html'
- '**.md'
- '**.html'
- '**.sln'
- '**.vcxproj'
- '**.xcodeproj'

pull_request:
paths-ignore:
- '**.js'
- '**.dfn'
- '**.scp'
- '**.txt'
- '**.html'
- '**.md'
- '**.html'
- '**.sln'
- '**.vcxproj'
- '**.xcodeproj'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
run: cmake make/cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}


33 changes: 0 additions & 33 deletions .github/workflows/main.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/windows_x64_build.yml

This file was deleted.

12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,10 @@ Join the [UOX3 Discord](https://discord.gg/uBAXxhF) for support and/or a quick c

> If you don't wish to rely on the automake.sh script, but want control over the process yourself, follow these steps (same as what automake.sh does) in a Terminal. This also works on Windows/macOS as an alternative to compiling with IDEs:
> - Navigate to root of cloned UOX3 git repository, and execute these commands:\
> `cd make/cmake`\
> `mkdir build`\
> `cd build`\
> `cmake .. -DCMAKE_BUILD_TYPE=Release` (Windows/Linux/FreeBSD)\
> `cmake .. -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"` (macOS)\
> `cmake --build . --config Release`\
> Replace "Release" with "Debug" in the above instructions to create a debug-build; delete **make/cmake/build** directory to do clean builds.
> `cmake make/cmake -B ./build -DCMAKE_BUILD_TYPE=Release`\
> `cmake --build ./build --config Release`
> Replace "Release" with "Debug" in the above instructions to create a debug-build; delete **build** directory to do clean builds.
</details>
<details>
Expand Down
25 changes: 22 additions & 3 deletions make/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ else()
target_compile_options( uox3 PRIVATE
-funsigned-char
-Wno-shift-negative-value
-Wno-deprecated-declarations
)
if (APPLE)
# We always use the system zlib , as it is most likely better optimized
set(SYSTEM_ZLIB ON)

target_compile_options( uox3 PRIVATE
$<$<CONFIG:Release>:-Os>
)
Expand All @@ -223,24 +227,39 @@ target_include_directories(uox3
PUBLIC
${PROJECT_SOURCE_DIR}/../../source
${PROJECT_SOURCE_DIR}/../../spidermonkey
)
if (NOT SYSTEM_ZLIB)
target_include_directories(uox3
PUBLIC
${PROJECT_SOURCE_DIR}/../../zlib
)

endif (NOT SYSTEM_ZLIB)
# *************************************************************************
# The libraries we need
# *************************************************************************
target_link_libraries(uox3 PRIVATE
jscript
zlib
$<$<PLATFORM_ID:Windows>:ws2_32>
$<$<PLATFORM_ID:Windows>:Kernel32>
$<$<PLATFORM_ID:Linux>:pthread>
$<$<PLATFORM_ID:FreeBSD>:pthread>
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>
)

if (NOT SYSTEM_ZLIB)
target_link_libraries(uox3 PRIVATE
zlib
)
else()
target_link_libraries(uox3 PRIVATE
z
)
endif(NOT SYSTEM_ZLIB)

# *************************************************************************
# The items we need built first
# *************************************************************************
add_subdirectory(${PROJECT_SOURCE_DIR}/../../spidermonkey/make/cmake subproject/jscript)
add_subdirectory(${PROJECT_SOURCE_DIR}/../../zlib/make/cmake subproject/zlib)
if (NOT SYSTEM_ZLIB)
add_subdirectory(${PROJECT_SOURCE_DIR}/../../zlib/make/cmake subproject/zlib)
endif(NOT SYSTEM_ZLIB)
14 changes: 12 additions & 2 deletions spidermonkey/make/XCode/jscript/jscript.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,10 @@
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 13.3;
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = "-Wno-format-security";
WARNING_CFLAGS = (
"-Wno-format-security",
"-Wno-deprecated-declarations",
);
};
name = Debug;
};
Expand All @@ -1065,7 +1068,10 @@
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 13.3;
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = "-Wno-format-security";
WARNING_CFLAGS = (
"-Wno-format-security",
"-Wno-deprecated-declarations",
);
};
name = Release;
};
Expand Down Expand Up @@ -1223,6 +1229,8 @@
"-Wno-tautological-constant-out-of-range-compare",
"-Wno-pointer-to-int-cast",
"-Wno-format-security",
"-Wno-tautological-constant-compare",
"-Wno-deprecated-declarations",
);
};
name = Debug;
Expand Down Expand Up @@ -1270,6 +1278,8 @@
"-Wno-tautological-constant-out-of-range-compare",
"-Wno-pointer-to-int-cast",
"-Wno-format-security",
"-Wno-tautological-constant-compare",
"-Wno-deprecated-declarations",
);
};
name = Release;
Expand Down
9 changes: 9 additions & 0 deletions spidermonkey/make/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ project(jscript VERSION 1.8.0 LANGUAGES C)
add_executable(jscpucfg ../../jscpucfg.c)

if(NOT WIN32)
target_compile_options( jscpucfg PRIVATE
-Wno-format-security
-Wno-deprecated-declarations
$<$<CONFIG:Release>:-Os>
)

add_custom_command(
OUTPUT ../../jsautocfg.h
COMMAND echo ${CMAKE_CURRENT_SOURCE_DIR} && ./jscpucfg > ${CMAKE_CURRENT_SOURCE_DIR}/../../jsautocfg.h && echo "Build complete"
Expand Down Expand Up @@ -157,11 +163,14 @@ else()
-Wno-pointer-to-int-cast
-Wno-switch
-Wno-incompatible-pointer-types
-Wno-deprecated-declarations
-Wno-format-security
)
if (APPLE)
target_compile_options( jscript PRIVATE
-Wno-non-literal-null-conversion
-Wno-tautological-constant-out-of-range-compare
-Wno-tautological-constant-compare
$<$<CONFIG:Release>:-Os>
)
elseif (UNIX AND NOT APPLE AND NOT LINUX)
Expand Down

0 comments on commit cf13a1c

Please sign in to comment.