Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change CI CMake build to use Open Watcom toolchain #955

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jmalak
Copy link

@jmalak jmalak commented Mar 25, 2024

add __export modifier if DLL is requested to properly generate import library zlib.lib for OS/2
add CMake cross-compilation build by Open Watcom for 16/32-bit DOS and OS2, 32-bit Windows and 32-bit Linux

@madler
Copy link
Owner

madler commented Mar 30, 2024

Have you tested all of those builds you are proposing to add to cmake.yml?

@jmalak
Copy link
Author

jmalak commented Mar 30, 2024

I tested build only.
For Windows it is build static library and DLL and link samples with DLL and run samples.
For Linux it is build static library only and link samples with static library and run samples.
For DOS it is build only static library and link samples, not tested.
For OS/2 it is build DLL and link samples with DLL, not tested.

You can check build and test result here

- name: Generate project files
run: cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }}
if: matrix.compiler != 'watcom'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step shouldn't need a separate version for watcom.

Copy link
Author

@jmalak jmalak Mar 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to change anything for other compilers because I have no experiencies with them and cmake.
matrix.compiler is as class for watcom instead of for others. Also cmake support Watcom compilers cross-compilation without need of special cmake configuration scripts. it is control directly by CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR macros. And also reference to current directory for output files is not good solution for Watcom because some intermediate files created by Watcom overwrite zlib source files. That during testing destroys sources and you cannot repeate steps. I did it this simple way that matrix.compiler is used to switch to watcom logic and not control Watcom version etc. It can be changed to any other variable, but we need to know if WATCOM toolchain or others somehow to switch between two modes.

!!!! Important change is that you must not setup environment CC: ${{ matrix.compiler }} for Watcom, which is main reason to do it this way for watcom (you must not setup CC: variable any way) !!!!!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated CI CMake build change from OS/2 build fix that here is only CI CMake related changes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE for CMake use with watcom:

  • watcom must be used with -G "Watcom WMake" because it setup WATCOM stuff in CMake
  • watcom mode in CMake doesn't use POSIX CC mechanism, therefore you cannot use CC environment variable

@jmalak jmalak marked this pull request as draft March 30, 2024 20:37
@jmalak
Copy link
Author

jmalak commented Mar 31, 2024

I submit new #958 PR with OS/2 DLLbuild fix that this PR is only for CI CMake build changes

@jmalak jmalak changed the title correct open watcom build for OS/2, add automated builds by Open Watcom change CI CMake build to use Open Watcom toolchain Mar 31, 2024
@jmalak jmalak force-pushed the open-watcom branch 2 times, most recently from 930fc6c to 2517533 Compare April 2, 2024 06:17
@jmalak
Copy link
Author

jmalak commented Apr 2, 2024

I little reworked CI CMake actions script by using if conditions to follow existing workflow without specific actions for Watcom
Now it is fully controlled by if conditions

@jmalak jmalak force-pushed the open-watcom branch 2 times, most recently from 2c5b1f1 to 3f2d875 Compare April 2, 2024 06:41
.github/workflows/cmake.yml Outdated Show resolved Hide resolved
.github/workflows/cmake.yml Outdated Show resolved Hide resolved
.github/workflows/cmake.yml Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@jmalak jmalak force-pushed the open-watcom branch 3 times, most recently from 1c6e089 to e6dfa25 Compare April 10, 2024 09:05
@jmalak
Copy link
Author

jmalak commented Apr 15, 2024

Pre-requisity for this change is PR "correct Open Watcom OS/2 build #958"

@jmalak jmalak marked this pull request as ready for review April 17, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants