Changeset ba8ecc8 in OpenModelica


Ignore:
Timestamp:
2022-05-18T13:26:17+02:00 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master
Children:
078d624, 0c2f2b0, 55b51792, f0e38eb
Parents:
648929c
git-author:
Mahder Gebremedhin <mahge@…> (05/18/22 13:26:17)
git-committer:
GitHub <noreply@…> (05/18/22 13:26:17)
Message:

Fix compilation on OMDev/MinGW with CMake (#8976)

  • GC has a setting where it gets compiled as a single file (a file that includes all source files). According to the logs of the upstream GC repository this is done to enable more optimizations. It also enabled this one-file form when it was asked to build a shared library with CMake. Even if it was not asked for explicitly.

However, the markup for the functions was missing the extern keyword
which leads to some confusing duplicate declaration errors.

Add the extern specifier. But also disable the automatic one-file
compilation for shared version
behavior since the autoconf build does
not enable it unless it is asked for explicitly.

We are trying to be consistent to avoid ANY surprises with this useful
(I admit) but so very intrusive and infuriating library.

  • Now that GC is a shared library copy the dll the directory where we generate the bootstrapped omc so that it can function.
Location:
OMCompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/3rdParty

    • Property commit changed from a3d6dae8301f7fa03292a35aae0ced8b710fca5d to 8297b96891df13fd9e0c319042ea4912e023e826
  • OMCompiler/Compiler/boot/CMakeLists.txt

    ra20fdfdf rba8ecc8  
    8383
    8484# On Windows it also needs to have the dlls it depends on (remember bomc is being used without being installed)
    85 # think of this as a manual install for it. Luckily it depends only on one dll for now,
     85# think of this as a manual install for it. Luckily it depends only on just two dlls for now,
    8686if(WIN32)
    8787  add_custom_command (
     
    8989    POST_BUILD
    9090    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:omc::simrt::runtime> ${CMAKE_CURRENT_BINARY_DIR}/bootstrapped/bin
    91     COMMENT "Copying OpenModelicaRuntimeC.dll for the bootstrapped omc (to ${CMAKE_CURRENT_BINARY_DIR}/bootstrapped/bin).")
     91    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:omc::3rd::omcgc> ${CMAKE_CURRENT_BINARY_DIR}/bootstrapped/bin
     92    COMMENT "Copying libOpenModelicaRuntimeC.dll and libomcgc.dll for the bootstrapped omc (to ${CMAKE_CURRENT_BINARY_DIR}/bootstrapped/bin).")
    9293endif()
    9394
Note: See TracChangeset for help on using the changeset viewer.