Skip to content

Commit

Permalink
Fix build system breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterman committed Apr 10, 2023
1 parent 1c01c47 commit fd5523d
Showing 1 changed file with 37 additions and 38 deletions.
75 changes: 37 additions & 38 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.15)
project(PySAMP)

cmake_minimum_required(VERSION 3.15)
list(APPEND CMAKE_MODULE_PATH ${SAMPGDK_DIR}/cmake)
include(AMXConfig)
include(AddSAMPPlugin)
include(FindSAMPSDK)

set(PYSAMP_MAJOR_VERSION 2)
set(PYSAMP_MINOR_VERSION 1)
Expand All @@ -10,7 +13,37 @@ set(PYSAMP_REVISION 0)
set(PYSAMP_VERSION "${PYSAMP_MAJOR_VERSION}.${PYSAMP_MINOR_VERSION}.${PYSAMP_REVISION}")
add_definitions(-DPYSAMP_VERSION=${PYSAMP_VERSION})

if(MSVC AND !DEBUG)
if(MSVC)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 11)
endif()

add_samp_plugin(PySAMP
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.c
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.h
${SAMPSDK_DIR}/amxplugin.cpp
${CMAKE_BINARY_DIR}/generated/config.h
main.h
main.cpp
main.def
pysamp/pysamp.cpp
pysamp/pysamp.h
pysamp/pygamemode.cpp
pysamp/pygamemode.h
pysamp/timer.cpp
pysamp/timer.h
pysamp/callbacks.cpp
pysamp/callbacks.h
pysamp/param_converter.cpp
pysamp/param_converter.h
bindings/samp.cpp
bindings/samp.h
bindings/logprintf.cpp
bindings/logprintf.h
)

if(MSVC AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
find_package(
Python3
COMPONENTS Development.SABIModule
Expand All @@ -22,18 +55,14 @@ if(MSVC AND !DEBUG)
else()
find_package(
Python3
COMPONENTS Development.Module
COMPONENTS Development.Embed
REQUIRED
)
message(STATUS "Python3_INCLUDE_DIRS = ${Python3_INCLUDE_DIRS}")
message(STATUS "Python3_LIBRARIES = ${Python3_LIBRARIES}")
target_link_libraries(PySAMP Python3::Module)
target_link_libraries(PySAMP Python3::Python)
endif()

include(AMXConfig)
include(AddSAMPPlugin)
include(FindSAMPSDK)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SAMPSDK_DIR}/amx
Expand All @@ -49,36 +78,6 @@ add_definitions(-DSAMPGDK_AMALGAMATION)

configure_file(config.h.in ${CMAKE_BINARY_DIR}/generated/config.h)

if(MSVC)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 11)
endif()

add_samp_plugin(PySAMP
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.c
${SAMPGDK_DIR}/build/lib/sampgdk/sampgdk.h
${SAMPSDK_DIR}/amxplugin.cpp
${CMAKE_BINARY_DIR}/generated/config.h
main.h
main.cpp
main.def
pysamp/pysamp.cpp
pysamp/pysamp.h
pysamp/pygamemode.cpp
pysamp/pygamemode.h
pysamp/timer.cpp
pysamp/timer.h
pysamp/callbacks.cpp
pysamp/callbacks.h
pysamp/param_converter.cpp
pysamp/param_converter.h
bindings/samp.cpp
bindings/samp.h
bindings/logprintf.cpp
bindings/logprintf.h
)

find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
Expand Down

0 comments on commit fd5523d

Please sign in to comment.