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

Remove unused configuration variables. #1230

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 1 addition & 45 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ ROOT_DIR=$(shell pwd)

# Option to enable AddressSanitizer
ASAN ?= OFF
# Statically link dependencies as much as possible
STATIC ?= OFF
# Option to switch between Debug and Release builds
BUILD_TYPE ?= Release

Expand All @@ -20,37 +18,18 @@ ifeq ($(detected_OS),Darwin)
BUILD_DIR := build/mac
INSTALL_DIR := install/mac
CMAKE_TARGET=-DCMAKE_SYSTEM_NAME=$(detected_OS)
FEXT=.dylib
CMAKE_FPIC=-DCMAKE_C_FLAGS="-fPIC"
else ifeq (MINGW32,$(findstring MINGW32,$(detected_OS)))
BUILD_DIR := build/mingw
INSTALL_DIR := install/mingw
CMAKE_TARGET=-G "MSYS Makefiles"
FEXT=.dll
EEXT=.exe
ifeq (clang,$(findstring clang,$(CC)))
DISABLE_SHARED = --disable-shared
endif
else ifeq (MINGW,$(findstring MINGW,$(detected_OS)))
BUILD_DIR := build/mingw
INSTALL_DIR := install/mingw
CMAKE_TARGET=-G "MSYS Makefiles"
FEXT=.dll
EEXT=.exe
ifeq (clang,$(findstring clang,$(CC)))
DISABLE_SHARED = --disable-shared
endif
else
BUILD_DIR := build/linux
INSTALL_DIR := install/linux
CMAKE_TARGET=-DCMAKE_SYSTEM_NAME=$(detected_OS)
FEXT=.so
CMAKE_FPIC=-DCMAKE_C_FLAGS="-fPIC"
endif

ifeq ($(STATIC),ON)
# Do not use -DBoost_USE_STATIC_LIBS=ON; it messes up -static in alpine/musl
CMAKE_STATIC=-DBUILD_SHARED=OFF
endif

# use cmake from above if is set, otherwise cmake
Expand All @@ -62,20 +41,9 @@ endif
ifeq ($(OMBUILDDIR),)
TOP_INSTALL_DIR=$(INSTALL_DIR)
CMAKE_INSTALL_PREFIX=-DCMAKE_INSTALL_PREFIX=$(TOP_INSTALL_DIR)
HOST_SHORT=
else
TOP_INSTALL_DIR=$(OMBUILDDIR)
CMAKE_INSTALL_PREFIX=-DCMAKE_INSTALL_PREFIX=$(OMBUILDDIR)
ifeq ($(host_short),)
HOST_SHORT=-DHOST_SHORT=
else
HOST_SHORT_OMC=$(host_short)/omc
HOST_SHORT=-DHOST_SHORT=$(HOST_SHORT_OMC)
endif
endif

ifeq ($(detected_OS),Darwin)
EXTRA_CMAKE=-DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="`pwd`/$(TOP_INSTALL_DIR)/lib/$(HOST_SHORT_OMC)"
endif

ifneq ($(CROSS_TRIPLE),)
Expand All @@ -92,7 +60,7 @@ ifneq ($(CROSS_TRIPLE),)
DISABLE_RUN_OMSIMULATOR_VERSION ?= 1
endif

.PHONY: OMSimulator OMSimulatorCore config-OMSimulator config-xerces config-3rdParty distclean testsuite doc doc-html doc-doxygen pip
.PHONY: OMSimulator OMSimulatorCore config-OMSimulator config-3rdParty distclean testsuite doc doc-html doc-doxygen pip

OMSimulator:
@echo OS: $(detected_OS)
Expand Down Expand Up @@ -133,24 +101,12 @@ $(BUILD_DIR)/Makefile: CMakeLists.txt
$(MKDIR) $(BUILD_DIR)
$(CMAKE) -S . -B $(BUILD_DIR) $(CMAKE_TARGET) -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DASAN:BOOL=$(ASAN) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) $(CMAKE_INSTALL_PREFIX) $(HOST_SHORT) $(EXTRA_CMAKE) $(CMAKE_STATIC)

config-xerces: 3rdParty/xerces/$(INSTALL_DIR)/lib/libxerces-c.a
3rdParty/xerces/$(INSTALL_DIR)/lib/libxerces-c.a: 3rdParty/xerces/$(BUILD_DIR)/Makefile
$(MAKE) -C 3rdParty/xerces/$(BUILD_DIR)/ install
3rdParty/xerces/$(BUILD_DIR)/Makefile: 3rdParty/xerces/CMakeLists.txt
@echo
@echo "# config xerces"
@echo
$(MKDIR) 3rdParty/xerces/$(BUILD_DIR)
cd 3rdParty/xerces/$(BUILD_DIR) && $(CMAKE) $(CMAKE_TARGET) ../.. -DCMAKE_INSTALL_PREFIX=../../$(INSTALL_DIR) -DBUILD_SHARED_LIBS:BOOL=OFF

distclean:
@echo
@echo "# make distclean"
@echo
$(RM) $(BUILD_DIR)
$(RM) $(INSTALL_DIR)
$(RM) 3rdParty/xerces/$(BUILD_DIR)
$(RM) 3rdParty/xerces/$(INSTALL_DIR)

testsuite:
@echo
Expand Down
18 changes: 0 additions & 18 deletions configWinVS.bat
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ IF NOT EXIST install\\win\\lib MKDIR install\\win\\lib

@REM do not change the order to be consistent with line 265 config all
IF ["%TARGET%"]==["clean"] GOTO clean
IF ["%TARGET%"]==["xerces"] GOTO xerces
IF ["%TARGET%"]==["pthread"] GOTO pthread
IF ["%TARGET%"]==["omsimulator"] GOTO omsimulator
IF ["%TARGET%"]==["all"] GOTO all
Expand All @@ -79,23 +78,6 @@ EXIT /B 0
:: -- clean ---------------------------


:: -- config xerces -------------------
:xerces
ECHO # config xerces
IF EXIST "3rdParty\xerces\build\win\" RMDIR /S /Q 3rdParty\xerces\build\win
IF EXIST "3rdParty\xerces\install\win\" RMDIR /S /Q 3rdParty\xerces\install\win
MKDIR 3rdParty\xerces\build\win
CD 3rdParty\xerces\build\win
cmake.exe -G %OMS_VS_VERSION% ..\.. -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX=..\..\install\win -DBUILD_SHARED_LIBS:BOOL=OFF
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
CD ..\..\..\..
ECHO # build xerces
msbuild.exe "3rdParty\xerces\build\win\INSTALL.vcxproj" /t:Build /p:configuration=Release /maxcpucount
IF NOT ["%ERRORLEVEL%"]==["0"] GOTO fail
EXIT /B 0
:: -- config xerces -------------------


:: -- pthread -------------------------
:pthread
ECHO # config pthread
Expand Down
6 changes: 3 additions & 3 deletions src/OMSimulatorPython/capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
class capi:
def __init__(self):
dirname = os.path.dirname(__file__)
omslib = os.path.join(dirname, "@OMSIMULATORLIB_DIR_STRING@", "@OMSIMULATORLIB_STRING@")
omslib = os.path.join(dirname, "@OMSIMULATORLIB_STRING@")
# attempt to fix #8163 on Linux
if not os.path.exists(omslib):
omslib = os.path.join(dirname, "..", "@OMSIMULATORLIB_DIR_STRING@", "@OMSIMULATORLIB_STRING@")
omslib = os.path.join(dirname, "..", "@OMSIMULATORLIB_STRING@")

if os.name == 'nt': # Windows
omslib = os.path.join(dirname, "../../bin/", "@OMSIMULATORLIB_DIR_STRING@", "@OMSIMULATORLIB_STRING@")
omslib = os.path.join(dirname, "../../bin/", "@OMSIMULATORLIB_STRING@")
dllDir = os.add_dll_directory(os.path.dirname(omslib))
self.obj=ctypes.CDLL(omslib)
if os.name == 'nt': # Windows
Expand Down