Skip to content

Commit

Permalink
Remove submodules, use CMake's FetchContent instead. (#534)
Browse files Browse the repository at this point in the history
* Remove submodules, use CMake's FetchContent instead.

* Update docs and CI file.

* I think we don't actually need this at all...

* Restore some missing `target_link_libraries` in test dependencies.
  • Loading branch information
grojo-ea committed Jul 29, 2024
1 parent cf368d5 commit c530255
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 46 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ on:

jobs:
checkout:
name: Checkout EASTL and submodules
name: Checkout EASTL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: EASTL/
- run: cd EASTL/ && git submodule update --init
- name: Upload checked out code
uses: actions/[email protected]
with:
Expand Down
18 changes: 0 additions & 18 deletions .gitmodules

This file was deleted.

14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#-------------------------------------------------------------------------------------------
# Copyright (C) Electronic Arts Inc. All rights reserved.
#-------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.11)
include(FetchContent)
project(EASTL CXX)

#-------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -64,9 +65,14 @@ target_include_directories(EASTL PUBLIC include)
#-------------------------------------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------------------------------------
if (NOT TARGET EABase)
add_subdirectory(test/packages/EABase)
endif()
FetchContent_Declare(
EABase
GIT_REPOSITORY https://github.com/electronicarts/EABase.git
GIT_TAG 521cb053d9320636f53226ffc616216cf532f0ef
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
)

FetchContent_MakeAvailable(EABase)

target_link_libraries(EASTL EABase)

Expand Down
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ Your pull request should:

### Getting the Repository

EASTL uses git submodules for its dependencies as they are seperate git repositories. Recursive clones will continue until HD space is exhausted unless they are manually limited.
It is recommended to use the following to get the source:

```bash
git clone https://github.com/electronicarts/EASTL
cd EASTL
git submodule update --init
```

### Running the Unit Tests

EASTL uses CMake as its build system.
EASTL uses CMake as its build system.

* Create and navigate to "your_build_folder":
* mkdir your_build_folder && cd your_build_folder
Expand Down
61 changes: 51 additions & 10 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#-------------------------------------------------------------------------------------------
# CMake info
#-------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.11)
project(EASTLTest CXX)
include(CTest)

Expand Down Expand Up @@ -74,21 +74,62 @@ target_include_directories(EASTLTest PUBLIC include)
#-------------------------------------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------------------------------------
add_subdirectory(packages/EABase)
add_subdirectory(packages/EAAssert)
add_subdirectory(packages/EAStdC)
add_subdirectory(packages/EAMain)
add_subdirectory(packages/EATest)
add_subdirectory(packages/EAThread)

FetchContent_Declare(
EABase
GIT_REPOSITORY https://github.com/electronicarts/EABase.git
GIT_TAG 521cb053d9320636f53226ffc616216cf532f0ef
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
)
FetchContent_MakeAvailable(EABase)
target_link_libraries(EASTLTest EABase)

FetchContent_Declare(
EAAssert
GIT_REPOSITORY https://github.com/electronicarts/EAAssert.git
GIT_TAG e5e181255de2e883dd1f987c78ccc42ac81d3bca
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EAAssert.
)
FetchContent_MakeAvailable(EAAssert)
target_link_libraries(EASTLTest EAAssert)
target_link_libraries(EASTLTest EAMain)
target_link_libraries(EASTLTest EASTL)

FetchContent_Declare(
EAStdC
GIT_REPOSITORY https://github.com/electronicarts/EAStdC.git
GIT_TAG fbcc34e89c63636054334888f3a5bd7ac2fd4b76
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EAStdC.
)
FetchContent_MakeAvailable(EAStdC)
target_link_libraries(EASTLTest EAStdC)

FetchContent_Declare(
EAMain
GIT_REPOSITORY https://github.com/electronicarts/EAMain.git
GIT_TAG 24ca8bf09e6b47b860286fc2f4c832f4009273d1
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EAMain.
)
FetchContent_MakeAvailable(EAMain)
target_link_libraries(EASTLTest EAMain)

FetchContent_Declare(
EATest
GIT_REPOSITORY https://github.com/electronicarts/EATest.git
GIT_TAG a59b372fc9cba517283ad6d060d2ab96e0ba34ac
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EATest.
)
FetchContent_MakeAvailable(EATest)
target_link_libraries(EASTLTest EATest)

FetchContent_Declare(
EAThread
GIT_REPOSITORY https://github.com/electronicarts/EAThread.git
GIT_TAG f3c6c54d19699639a5edcf5237ea8b71aca6842c
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EAThread.
)
FetchContent_MakeAvailable(EAThread)
target_link_libraries(EASTLTest EAThread)

target_link_libraries(EASTLTest EASTL)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

Expand Down
1 change: 0 additions & 1 deletion test/packages/EAAssert
Submodule EAAssert deleted from e5e181
1 change: 0 additions & 1 deletion test/packages/EABase
Submodule EABase deleted from 521cb0
1 change: 0 additions & 1 deletion test/packages/EAMain
Submodule EAMain deleted from 24ca8b
1 change: 0 additions & 1 deletion test/packages/EAStdC
Submodule EAStdC deleted from 8dc9e3
1 change: 0 additions & 1 deletion test/packages/EATest
Submodule EATest deleted from a59b37
1 change: 0 additions & 1 deletion test/packages/EAThread
Submodule EAThread deleted from e4367a

0 comments on commit c530255

Please sign in to comment.