Skip to content

Commit

Permalink
avoid duplicate boost headers for windows (#9068)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Jun 8, 2022
1 parent 9d4a80a commit fa321a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
2 changes: 0 additions & 2 deletions OMCompiler/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ emcc-simulationruntime:
mkdir -p build/lib/omc/emcc/
$(MAKE) -C SimulationRuntime/c emcc

copycppheader:

OMDEV_CMAKE="$(OMDEV)/bin/cmake/bin/cmake.exe"

checkMSVCwine:
Expand Down
24 changes: 3 additions & 21 deletions OMCompiler/Makefile.omdev.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ SEMLA_LIB=semla
SEMLA_CLEAN=semla-clean
endif

main.PHONY: simulationruntimecmsvc runtimeCPPinstall runtimeCPPmsvcinstall OMSICPPinstall getMSVCversion omdev_extra_dlls install-openturns copycppheader copycppmsvcheader boehm-gc-lib fmil_msvc sundials_msvc CMinpack_msvc suitesparse_msvc runtimeOMSIBaseMSVCInstall omcCAPImsvcinstall
main.PHONY: simulationruntimecmsvc runtimeCPPinstall runtimeCPPmsvcinstall OMSICPPinstall getMSVCversion omdev_extra_dlls install-openturns copycppmsvcheader boehm-gc-lib fmil_msvc sundials_msvc CMinpack_msvc suitesparse_msvc runtimeOMSIBaseMSVCInstall omcCAPImsvcinstall

include Makefile.common
include Makefile.omsi.common
Expand Down Expand Up @@ -300,30 +300,12 @@ endif
(cp -pufr $(OMDEVMSYS)/tools/xsltproc $(builddir_lib)/omc/libexec/)
(cp -pufr $(OMDEVMSYS)/tools/gnuplot $(builddir_lib)/omc/libexec/)

copycppheader: copycppheader_old
echo Copying needed header files to the $(OMBUILDDIR)/include/omc/omsicpp directory
(mkdir -p $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/gcc/boost)
(cp -puf $(BOOST_PATH)/boost/*.hpp $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/gcc/boost)
(cp -pufr $(BOOST_PATH)/boost/* $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/gcc/boost)

copycppmsvcheader: getMSVCversion copycppmsvcheader_old
copycppmsvcheader: getMSVCversion
echo Copying needed header files to the $(OMBUILDDIR)/include/omc/omsicpp/ directory
(mkdir -p $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/msvc/boost)
(cp -puf $(BOOST_PATH_MSVC)/boost/*.hpp $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/msvc/boost)
(cp -pufr $(BOOST_PATH_MSVC)/boost/* $(OMBUILDDIR)/include/omc/omsicpp/3rdParty/boost/msvc/boost)

copycppheader_old:
echo Copying needed header files to the $(OMBUILDDIR)/include/omc/cpp directory
(mkdir -p $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/gcc/boost)
(cp -puf $(BOOST_PATH)/boost/*.hpp $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/gcc/boost)
(cp -pufr $(BOOST_PATH)/boost/* $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/gcc/boost)

copycppmsvcheader_old: getMSVCversion
echo Copying needed header files to the $(OMBUILDDIR)/include/omc/cpp/ directory
(mkdir -p $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/msvc/boost)
(cp -puf $(BOOST_PATH_MSVC)/boost/*.hpp $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/msvc/boost)
(cp -pufr $(BOOST_PATH_MSVC)/boost/* $(OMBUILDDIR)/include/omc/cpp/3rdParty/boost/msvc/boost)

omc: interactive fmil omdev_extra_dlls breakprocess opencl_rt CMinpack metis Cdaskr $(IPOPT_TARGET) $(SEMLA_LIB) OMSI parmodauto ModelicaExternalC
(time $(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" omc-bootstrapped OMBUILDDIR=$(OMBUILDDIR))

Expand Down Expand Up @@ -499,7 +481,7 @@ $(OMBUILDDIR)/lib/omc/msvc/sundials_ida.dll: getMSVCversion 3rdParty/sundials-5.
omcCAPImsvcinstall:
$(MAKE) -C SimulationRuntime/OMSICpp/ -f Makefile.omdev.mingw omcCAPImsvc OMBUILDDIR=$(OMBUILDDIR)

runtimeCPPmsvcinstall_old: copycppmsvcheader_old
runtimeCPPmsvcinstall_old:
$(MAKE) -C SimulationRuntime/cpp/ -f Makefile.omdev.mingw runtimeCPPmsvc OMBUILDDIR=$(OMBUILDDIR)
cp -p $(BOOST_PATH_MSVC)/lib/*vc*.dll $(OMBUILDDIR)/bin/
cp -p $(BOOST_PATH_MSVC)/lib/*vc*.lib $(OMBUILDDIR)/lib/omc/cpp/msvc
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Makefile.omsi.common
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ OMSICClean:

OMSICPP: omc

OMSICPPinstall: copycppheader OMSICPP
OMSICPPinstall: OMSICPP
$(MAKE) -C SimulationRuntime/OMSICpp/ -f $(defaultMakefileTarget) CC="$(CC)" CXX="$(CXX)" install ANALYZATION_MODE="$(ANALYZATION_MODE)" $(CMAKE_ARGS) OMBUILDDIR=$(OMBUILDDIR) LIB_OMC=$(LIB_OMC)
# TODO: Fix this chaos!
# Correct every lib directly after it is compiled and before it is linked to the next target!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ IF(WIN32)
IF(MSVC)
SET(Boost_INCLUDE_ "$(OMHOME)/include/omc/omsicpp/3rdParty/boost/msvc/")
ELSE(MSVC)
SET(Boost_INCLUDE_ "$(OMHOME)/include/omc/omsicpp/3rdParty/boost/gcc/")
SET(Boost_INCLUDE_ "$(OMHOME)/tools/msys/mingw64/include/")
ENDIF(MSVC)

SET(SUNDIALS_LIBS_ "$(OMHOME)/bin")
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ ENDIF(CMAKE_BUILD_TYPE)
IF(WIN32)
SET(Boost_LIBS_ "$(OMHOME)/bin")
IF(MSVC)
SET(Boost_INCLUDE_ "$(OMHOME)/include/omc/cpp/3rdParty/boost/msvc/")
SET(Boost_INCLUDE_ "$(OMHOME)/include/omc/omsicpp/3rdParty/boost/msvc/")
ELSE(MSVC)
SET(Boost_INCLUDE_ "$(OMHOME)/include/omc/cpp/3rdParty/boost/gcc/")
SET(Boost_INCLUDE_ "$(OMHOME)/tools/msys/mingw64/include/")
ENDIF(MSVC)

SET(SUNDIALS_LIBS_ "$(OMHOME)/bin")
Expand Down

0 comments on commit fa321a0

Please sign in to comment.