Skip to content

Commit 34e7dde

Browse files
authored
Build lib Files with gcc on Windows (#6753)
* build lib files with gcc * remove references to Visual Studio * remove unneeded def files * include lib files in distribution * update the changelog * fix test step names * missing change from previous commit
1 parent 6e8f7f3 commit 34e7dde

File tree

13 files changed

+23
-1471
lines changed

13 files changed

+23
-1471
lines changed

.github/workflows/test_suite_windows.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,15 @@ jobs:
5959
- uses: actions/setup-python@v4
6060
with:
6161
python-version: '3.11'
62-
- name: Install Visual Studio 10 and OpenJDK 18
62+
- name: Install OpenJDK 18
6363
shell: powershell
64-
run: |
65-
choco install -y openjdk --version=18.0.2
66-
choco install -y visualcpp-build-tools
64+
run: choco install -y openjdk --version=18.0.2
6765
- name: Install Webots Compilation Dependencies
6866
run: |
6967
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
7068
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
7169
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
7270
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
73-
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
7471
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
7572
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
7673
export WEBOTS_HOME=$GITHUB_WORKSPACE
@@ -110,18 +107,15 @@ jobs:
110107
- uses: msys2/setup-msys2@v2
111108
with:
112109
update: false
113-
- name: Install Visual Studio 10 and OpenJDK 18
110+
- name: Install OpenJDK 18
114111
shell: powershell
115-
run: |
116-
choco install -y openjdk --version=18.0.2
117-
choco install -y visualcpp-build-tools
112+
run: choco install -y openjdk --version=18.0.2
118113
- name: Install Webots Compilation Dependencies
119114
run: |
120115
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
121116
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
122117
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
123118
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
124-
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
125119
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
126120
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
127121
export WEBOTS_HOME=$GITHUB_WORKSPACE

.github/workflows/test_suite_windows_develop.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ jobs:
5555
- uses: actions/setup-python@v4
5656
with:
5757
python-version: '3.11'
58-
- name: Install Visual Studio 10 and OpenJDK 18
58+
- name: Install OpenJDK 18
5959
shell: powershell
60-
run: |
61-
choco install -y openjdk --version=18.0.2
62-
choco install -y visualcpp-build-tools
60+
run: choco install -y openjdk --version=18.0.2
6361
- name: Install Webots Compilation Dependencies
6462
run: |
6563
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
6664
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
6765
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
6866
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
69-
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
7067
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
7168
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
7269
export WEBOTS_HOME=$GITHUB_WORKSPACE

docs/reference/changelog-r2025.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Webots R2025 Change Log
22

33
## Webots R2025b
4+
- Enhancements
5+
- Added missing import libraries on Windows ([#6753](https://github.com/cyberbotics/webots/pull/6753)).
6+
- Added some missing function definitions to the existing Windows libraries ([#6753](https://github.com/cyberbotics/webots/pull/6753)).
7+
- Cleanup
8+
- **Removed `libController.a` and `libCppController.a` libraries on Windows. Please use `Controller.lib` and `CppController.lib` instead ([#6753](https://github.com/cyberbotics/webots/pull/6753)).**
49
- Bug Fixes
510
- Fixed a bug preventing the `webots-controller` executable from running on arm-based mac devices ([#6806](https://github.com/cyberbotics/webots/pull/6806)).
611
- Fixed a bug causing Webots to crash when multiple sounds were used with a [Speaker](speaker.md) node ([#6843](https://github.com/cyberbotics/webots/pull/6843)).

projects/default/libraries/vehicle/c/car/car.def

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

projects/default/libraries/vehicle/c/driver/driver.def

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

projects/robots/kuka/youbot/libraries/youbot_control/youbot_control.def

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

resources/Makefile.include

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,6 @@ ifdef BUILD_STATIC_LIBRARY
391391
STATIC_LINK_FLAGS += rvs
392392
endif
393393

394-
# Visual Studio
395-
ifeq ($(OSTYPE),windows)
396-
ifdef BUILD_SHARED_LIBRARY
397-
ifndef USE_CXX
398-
ifneq ($(wildcard /C/Program\ Files\ */Microsoft\ Visual\ Studio/2017),)
399-
VISUAL_STUDIO_PATH?=/C/Program Files (x86)/Microsoft Visual Studio/2017
400-
endif
401-
VS_DEF_NAME = $(NAME).def
402-
endif
403-
endif
404-
endif
405-
406394
ifeq ($(OSTYPE),darwin)
407395
ifdef WEBOTS_LIBRARY
408396
INSTALL_NAME ?= @rpath/Contents/lib/controller/$(MAIN_TARGET)
@@ -486,6 +474,7 @@ MAIN_TARGET_COPY ?= $(MAIN_TARGET)
486474
MAIN_TARGET_WINDOWS64_LIB = $(MAIN_TARGET:.dll=.lib)
487475
endif
488476
ifeq ($(OSTYPE),windows)
477+
DYNAMIC_LINK_FLAGS += -Wl,--out-implib,$(MAIN_TARGET_WINDOWS64_LIB)
489478
FILES_TO_REMOVE += $(MAIN_TARGET_WINDOWS64_LIB)
490479
endif
491480

@@ -506,19 +495,6 @@ endif
506495
ifdef TARGET_LIB_DIR
507496

508497
$(MAIN_TARGET): $(TARGET_LIB_DIR)/$(MAIN_TARGET)
509-
ifdef VS_DEF_NAME
510-
@# Generate the .lib libraries to facilitate the integration with Visual Studio
511-
@# if the .def file is existing.
512-
@if [ -f $(VS_DEF_NAME) ]; then \
513-
if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \
514-
PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \
515-
mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \
516-
rm -f *.exp; \
517-
else \
518-
$(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \
519-
fi \
520-
fi
521-
endif
522498

523499
else
524500

@@ -528,19 +504,6 @@ $(MAIN_TARGET): $(BUILD_GOAL_DIR)/$(MAIN_TARGET)
528504
@# This new version will be executed only when the process restarts.
529505
@# Note: this binary may be an executable (e.g., a controller) or shared library (e.g., a physics plug-in).
530506
@rm -f $(MAIN_TARGET) > /dev/null 2>&1 && echo "# copying to" $(MAIN_TARGET_COPY) && cp $(BUILD_GOAL_DIR)/$(MAIN_TARGET) $(MAIN_TARGET_COPY) > /dev/null 2>&1
531-
ifdef VS_DEF_NAME
532-
@# Generate the .lib libraries to facilitate the integration with Visual Studio
533-
@# if the .def file is existing.
534-
@if [ -f $(VS_DEF_NAME) ]; then \
535-
if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \
536-
PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \
537-
mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \
538-
rm -f *.exp; \
539-
else \
540-
$(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \
541-
fi \
542-
fi
543-
endif
544507

545508
endif
546509

scripts/install/bash_profile.windows

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# export PYTHON_HOME="C:\Program Files\Python310" # Optionally defines the path to Python home.
77
# export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK` # Optionally defines the path to Java home.
88
# export MATLAB_HOME=/C/Program\ Files/MATLAB/R2018b # Optionally defines the path to MATLAB home.
9-
# export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017" # Optionally defines the path to Microsoft Visual Studio home.
109
# export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6" # Optionally defines the path to Inno Setup home.
1110

1211

scripts/packaging/files_core.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ lib/controller/ [windows,linux]
6464

6565
lib/controller/Controller [dll,windows,linux]
6666
lib/controller/Controller.lib [windows]
67-
lib/controller/libController.a [windows]
6867

6968
lib/controller/CppController [dll,windows,linux]
70-
lib/controller/libCppController.a [windows]
69+
lib/controller/CppController.lib [windows]
7170

7271
lib/controller/java/ [windows,linux]
7372
lib/controller/java/*.jar [windows,linux]
@@ -81,8 +80,11 @@ lib/controller/CppDriver [dll,windows,linux]
8180
lib/controller/driver [dll,windows,linux]
8281
lib/controller/car.lib [windows]
8382
lib/controller/driver.lib [windows]
83+
lib/controller/CppCar.lib [windows]
84+
lib/controller/CppDriver.lib [windows]
8485

8586
lib/controller/generic_robot_window [dll,windows,linux]
87+
lib/controller/generic_robot_window.lib [windows]
8688

8789
lib/controller/python/ [windows,linux]
8890
lib/controller/python/controller/ [windows,linux]

0 commit comments

Comments
 (0)