Skip to content

Commit eadbd3b

Browse files
author
Yannick Habecker
committed
fix: stop messing with gdk/sdk copying
1 parent c1aebff commit eadbd3b

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

docker/base.Dockerfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
FROM ubuntu:xenial
22
RUN dpkg --add-architecture i386
3-
RUN apt-get update
4-
RUN apt-get install -y python3.5-dev:i386
5-
RUN apt-get install -f
3+
RUN apt-get update && apt-get install -y python3.5-dev:i386
4+
RUN apt-get install -f
5+
6+
RUN apt-get update && apt-get install -y build-essential g++ cmake g++-multilib git
7+
RUN apt-get install -f
8+
9+
# install dependencies
10+
11+
RUN mkdir /root/sampgdk
12+
13+
RUN git clone https://github.com/Zeex/sampgdk.git /root/sampgdk
14+
RUN git clone https://github.com/Zeex/samp-plugin-sdk.git /root/sampsdk
15+
16+
RUN apt-get update && apt-get install -y python2.7 python-pip
17+
RUN pip install ply
18+
19+
RUN mkdir /root/sampgdk/build
20+
RUN cd /root/sampgdk/build && cmake .. -DSAMP_SDK_ROOT=/root/sampsdk -DSAMPGDK_STATIC=ON -DSAMPGDK_BUILD_AMALGAMATION=ON
21+
RUN cmake --build /root/sampgdk/build --config Release
22+
RUN cmake --build /root/sampgdk/build --config Release --target install

docker/compile.0.Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

docker/compile.Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
FROM pysamp/compile.0:latest
1+
FROM pysamp/base:latest
22
WORKDIR /usr/src/pysamp
33
COPY . .
4-
RUN [ "cmake", "./src", "-G", "Unix Makefiles", "-DPYTHON_INCLUDE_DIR=/usr/include/python3.5m", "-DPYTHON_LIBRARY=/usr/lib/i386-linux-gnu/libpython3.5m.so", "-DCMAKE_BUILD_TYPE=Debug" ]
5-
CMD make; cp ./pySAMP.so /target/
4+
5+
RUN [ "cmake", "./src", "-G", "Unix Makefiles", "-DSAMPSDK_DIR=/root/sampsdk", "-DSAMPGDK_DIR=/root/sampgdk", "-DPYTHON_INCLUDE_DIR=/usr/include/python3.5m", "-DPYTHON_LIBRARY=/usr/lib/i386-linux-gnu/libpython3.5m.so", "-DCMAKE_BUILD_TYPE=Debug" ]
6+
CMD make; cp ./PySAMP.so /target/

docker/make

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
docker build -f ./base.Dockerfile -t pysamp/base ../
2-
docker build -f ./compile.0.Dockerfile -t pysamp/compile.0 ../
32
docker build -f ./compile.Dockerfile -t pysamp/compile ../
43
docker run -v "$(cd ../ && pwd)"/target:/target --rm pysamp/compile

src/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ add_compile_options(-std=c++11)
44

55

66
cmake_minimum_required(VERSION 2.8)
7-
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
7+
list(APPEND CMAKE_MODULE_PATH ${SAMPGDK_DIR}/cmake)
88

99
#find_package (Python3 COMPONENTS Interpreter Development)
1010

@@ -13,10 +13,13 @@ find_package (PythonLibs 3.5.2)
1313

1414
include(AMXConfig)
1515
include(AddSAMPPlugin)
16+
include(FindSAMPSDK)
1617

1718
include_directories(
1819
${CMAKE_CURRENT_SOURCE_DIR}
19-
${CMAKE_CURRENT_SOURCE_DIR}/amx
20+
${SAMPSDK_DIR}/amx
21+
${SAMPGDK_DIR}/build/lib/sampgdk/
22+
${SAMPSDK_INCLUDE_DIR}
2023
${CMAKE_CURRENT_SOURCE_DIR}/bindings
2124
${CMAKE_CURRENT_SOURCE_DIR}/pysamp
2225
${PYTHON_INCLUDE_DIR}
@@ -30,13 +33,13 @@ add_definitions(-DSAMPGDK_AMALGAMATION)
3033

3134
link_libraries(${PYTHON_LIBRARIES})
3235

33-
add_samp_plugin(pySAMP
34-
amxplugin.cpp
36+
add_samp_plugin(PySAMP
37+
${SAMPSDK_DIR}/amxplugin.cpp
3538
main.h
3639
main.cpp
3740
main.def
38-
sampgdk.c
39-
sampgdk.h
41+
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.c
42+
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.h
4043
pysamp/pysamp.cpp
4144
pysamp/pysamp.h
4245
pysamp/pygamemode.cpp
@@ -49,6 +52,8 @@ add_samp_plugin(pySAMP
4952
test/callbackstest.cpp
5053
)
5154

55+
target_link_libraries(PySAMP sampgdk)
56+
5257
find_package(Doxygen)
5358
if(DOXYGEN_FOUND)
5459
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

0 commit comments

Comments
 (0)