Skip to content

Commit

Permalink
Merge pull request #38 from katursis/dev
Browse files Browse the repository at this point in the history
3.3.6
  • Loading branch information
katursis authored Sep 26, 2021
2 parents 89b6361 + 5541d91 commit 2d13396
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/samp-ptl"]
path = lib/samp-ptl
url = https://github.com/katursis/samp-ptl
[submodule "cmake/modules"]
path = cmake/modules
url = https://github.com/katursis/samp-cmake-modules
25 changes: 8 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ cmake_minimum_required(VERSION 3.10)

project(pawncmd)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DHAVE_STDINT_H)
endif()
include(AddSAMPPlugin)

include_directories(lib)
add_samp_plugin(${PROJECT_NAME}
plugin.def

add_library(${PROJECT_NAME} MODULE
src/Pawn.CMD.inc
src/main.h
src/main.cc
src/plugin.h
Expand All @@ -21,14 +18,8 @@ add_library(${PROJECT_NAME} MODULE
src/script.h
src/script.cc
src/command.h
src/Pawn.CMD.inc
plugin.def
)

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
lib/samp-ptl/ptl.h
)

if(CMAKE_COMPILER_IS_GNUCC)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE Off)
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS "-m32 -O3 -w")
set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS "-m32 -O3 -static-libgcc -static-libstdc++")
endif()
target_include_directories(${PROJECT_NAME} PRIVATE lib)
1 change: 1 addition & 0 deletions cmake/modules
Submodule modules added at 7fbf19
2 changes: 1 addition & 1 deletion lib/samp-ptl
2 changes: 1 addition & 1 deletion src/Pawn.CMD.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define PACK_PLUGIN_VERSION(%0,%1,%2) (((%0) << 16) | ((%1) << 8) | (%2))
#endif

#define PAWNCMD_VERSION PACK_PLUGIN_VERSION(3, 3, 5)
#define PAWNCMD_VERSION PACK_PLUGIN_VERSION(3, 3, 6)
#define PAWNCMD_INCLUDE_VERSION PAWNCMD_VERSION // backward compatibility

#if !defined __cplusplus
Expand Down
2 changes: 0 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#ifndef PAWNCMD_MAIN_H_
#define PAWNCMD_MAIN_H_

#define _GLIBCXX_USE_CXX11_ABI 0 // For compatibility with samp03svr that was compiled with an older (< 5.1) version of GCC

#include <queue>
#include <regex>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/script.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool Script::OnLoad() {

auto &plugin = Plugin::Instance();

for (std::size_t index{}; index < num_publics; index++) {
for (int index{}; index < num_publics; index++) {
std::string public_name = GetPublicName(index);
std::smatch match;
if (std::regex_match(public_name, match, regex_public_cmd_name_)) {
Expand Down

0 comments on commit 2d13396

Please sign in to comment.