Skip to content

Commit 120c765

Browse files
committed
Drop support for 32bit executables in C++ code
1 parent 2e6ec3a commit 120c765

File tree

10 files changed

+23
-83
lines changed

10 files changed

+23
-83
lines changed

CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ list(GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
1515
list(GET PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH)
1616
#####################################################################################
1717

18-
option(USE_64BIT_BUILD "USE_64BIT_BUILD" ON)
19-
2018
project(PythiaProject)
2119

2220
message(STATUS "Cmake version: ${CMAKE_VERSION}")
@@ -34,14 +32,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
3432
set(CMAKE_PREFIX_PATH "@Pythia/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-linux64")
3533

3634
else() # MSVC
37-
if(CMAKE_SIZEOF_VOID_P LESS 8)
38-
set(USE_64BIT_BUILD OFF)
39-
message(STATUS "Setting MSVC flags (32bit)")
40-
set(CMAKE_PREFIX_PATH "@Pythia/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-win32")
41-
else()
42-
message(STATUS "Setting MSVC flags (64bit)")
43-
set(CMAKE_PREFIX_PATH "@Pythia/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-amd64")
44-
endif()
35+
message(STATUS "Setting MSVC flags (64bit)")
36+
set(CMAKE_PREFIX_PATH "@Pythia/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-amd64")
4537

4638
message(STATUS "Setting MSVC flags")
4739

CMakeSettings.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@
1313
"variables": [
1414
]
1515
},
16-
{
17-
"name": "x86-Release",
18-
"generator": "Ninja",
19-
"configurationType": "RelWithDebInfo",
20-
"buildRoot": "${projectDir}\\out\\build\\${name}",
21-
"installRoot": "${projectDir}\\out\\install\\${name}",
22-
"cmakeCommandArgs": "",
23-
"buildCommandArgs": "",
24-
"ctestCommandArgs": "",
25-
"inheritEnvironments": [ "msvc_x86_x64" ],
26-
"variables": [
27-
]
28-
},
2916
{
3017
"name": "x64-WSL-GCC-Release",
3118
"generator": "Ninja",

src/Pythia/CMakeLists.txt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,9 @@ add_custom_command(
3636
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../@Pythia/"
3737
)
3838

39-
if(USE_64BIT_BUILD)
40-
set_target_properties(Pythia PROPERTIES
41-
OUTPUT_NAME "Pythia_x64"
42-
PREFIX ""
43-
BUILD_WITH_INSTALL_RPATH TRUE
44-
INSTALL_RPATH "\$ORIGIN/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-linux64/lib"
45-
)
46-
else()
47-
set_target_properties(Pythia PROPERTIES
48-
OUTPUT_NAME "Pythia"
49-
PREFIX ""
50-
BUILD_WITH_INSTALL_RPATH TRUE
51-
INSTALL_RPATH "\$ORIGIN/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-linux32/lib"
52-
)
53-
endif()
39+
set_target_properties(Pythia PROPERTIES
40+
OUTPUT_NAME "Pythia_x64"
41+
PREFIX ""
42+
BUILD_WITH_INSTALL_RPATH TRUE
43+
INSTALL_RPATH "\$ORIGIN/python-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}-embed-linux64/lib"
44+
)

src/Pythia/Paths.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
#include "Logger.h"
55

66
#ifdef _WIN32
7-
#ifdef _WIN64
87
#define EMBEDDEDPYTHONPATH L"python-" PYTHON_VERSION "-embed-amd64"
9-
#else
10-
#define EMBEDDEDPYTHONPATH L"python-" PYTHON_VERSION "-embed-win32"
11-
#endif
128
#else // ifdef _WIN32
139
#define EMBEDDEDPYTHONPATH "python-" PYTHON_VERSION "-embed-linux64"
1410
#endif

src/PythiaSetPythonPath/CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ add_custom_command(
2020
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../@Pythia/"
2121
)
2222

23-
if(USE_64BIT_BUILD)
24-
set_target_properties(PythiaSetPythonPath PROPERTIES
25-
OUTPUT_NAME "PythiaSetPythonPath_x64"
26-
PREFIX ""
27-
)
28-
else()
29-
set_target_properties(PythiaSetPythonPath PROPERTIES
30-
OUTPUT_NAME "PythiaSetPythonPath"
31-
PREFIX ""
32-
)
33-
endif()
23+
set_target_properties(PythiaSetPythonPath PROPERTIES
24+
OUTPUT_NAME "PythiaSetPythonPath_x64"
25+
PREFIX ""
26+
)

src/PythiaTester/ArmaExtension.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,8 @@ class ArmaExtension
8080
return;
8181
}
8282

83-
#if defined _WIN32 && !defined _WIN64
84-
rvextensionPtr = (RVExtension_t)getFunction("_RVExtension@12");
85-
rvextensionVersionPtr = (RVExtensionVersion_t)getFunction("_RVExtensionVersion@8");
86-
#else
87-
rvextensionPtr = (RVExtension_t)getFunction("RVExtension");
88-
rvextensionVersionPtr = (RVExtensionVersion_t)getFunction("RVExtensionVersion");
89-
#endif
83+
rvextensionPtr = (RVExtension_t)getFunction("RVExtension");
84+
rvextensionVersionPtr = (RVExtensionVersion_t)getFunction("RVExtensionVersion");
9085
}
9186

9287
void unload()
@@ -104,9 +99,7 @@ class ArmaExtension
10499
private:
105100
static std::string fixName(std::string name)
106101
{
107-
#if defined(_WIN64) || defined(__amd64__) || defined(_M_X64)
108-
name += "_x64";
109-
#endif
102+
name += "_x64";
110103

111104
#ifdef _WIN32
112105
name += ".dll";

src/PythiaTester/CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,11 @@ add_custom_command(
1616
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../@Pythia/"
1717
)
1818

19-
if(USE_64BIT_BUILD)
20-
set_target_properties(PythiaTester PROPERTIES
21-
OUTPUT_NAME "PythiaTester_x64"
22-
BUILD_WITH_INSTALL_RPATH TRUE
23-
INSTALL_RPATH "\$ORIGIN"
24-
)
25-
else()
26-
set_target_properties(PythiaTester PROPERTIES
27-
OUTPUT_NAME "PythiaTester"
28-
BUILD_WITH_INSTALL_RPATH TRUE
29-
INSTALL_RPATH "\$ORIGIN"
30-
)
31-
endif()
32-
19+
set_target_properties(PythiaTester PROPERTIES
20+
OUTPUT_NAME "PythiaTester_x64"
21+
BUILD_WITH_INSTALL_RPATH TRUE
22+
INSTALL_RPATH "\$ORIGIN"
23+
)
3324

3425
if(CMAKE_COMPILER_IS_GNUCXX)
3526
target_link_libraries(PythiaTester dl)

tests/tests.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ class Base(unittest.TestCase):
2424

2525
@staticmethod
2626
def pythia_tester():
27-
name = 'PythiaTester'
28-
29-
if platform.architecture()[0] == '64bit':
30-
name += '_x64'
27+
name = 'PythiaTester_x64'
3128

3229
if platform.system() == 'Windows':
3330
name += '.exe'

tools/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def build_binaries(version, system, run_tests=True):
105105
docker_prefix = []
106106
shell = True
107107

108-
_verbose_run(docker_prefix + ['cmake', '-G', 'Ninja', '-DUSE_64BIT_BUILD="ON"', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '..'], check=True, cwd='ninja', env=env, shell=shell)
108+
_verbose_run(docker_prefix + ['cmake', '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '..'], check=True, cwd='ninja', env=env, shell=shell)
109109
_verbose_run(docker_prefix + ['ninja'], check=True, cwd='ninja', env=env, shell=shell)
110110

111111

tools/rebuild64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ set -e
22

33
docker build -f Dockerfile.x64 -t pythia:latest .
44
rm -rf ninja/*
5-
docker run --rm -v "$(pwd)"/:/data -w /data/ninja pythia:latest cmake -G Ninja -DCMAKE_PREFIX_PATH=@Pythia/python-310-embed-linux64 -DUSE_64BIT_BUILD=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
5+
docker run --rm -v "$(pwd)"/:/data -w /data/ninja pythia:latest cmake -G Ninja -DCMAKE_PREFIX_PATH=@Pythia/python-310-embed-linux64 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
66
docker run --rm -v "$(pwd)"/:/data -w /data/ninja pythia:latest ninja

0 commit comments

Comments
 (0)