Skip to content

Commit

Permalink
Link dynamically on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikseipp committed Oct 3, 2023
1 parent a3c5d07 commit d903c17
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 31 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,12 @@ jobs:
echo "https://www.ibm.com/docs/en/icos/22.1.1?topic=2211-silent-installation-cplex-optimization-studio"
curl.exe --output cplex.exe $ENV:CPLEX_URL
echo %cd%
dir
mkdir D:\a\downward\downward # This directory only exists for repos called "downward".
mkdir D:\a\downward # This directory only exists for repos called "downward".
echo "Install CPLEX"
Start-Process -FilePath .\cplex.exe -ArgumentList "-f", "D:\a\scorpion\scorpion\.github\workflows\misc\cplex2211_windows_installer.properties" -PassThru | Wait-Process
Start-Process -FilePath .\cplex.exe -ArgumentList "-f", "$ENV:GITHUB_WORKSPACE\.github\workflows\misc\cplex2211_windows_installer.properties" -PassThru | Wait-Process
del .\cplex.exe
dir
dir D:\a
dir D:\a\downward
dir D:\a\scorpion
echo "Copy the relevant directory to a location which is not magically protected against cmake"
Xcopy /E /I D:\a\downward\cplex_temp\cplex $ENV:cplex_DIR
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ add_custom_command(TARGET translate POST_BUILD
COMMENT "Copying translator module into output directory")

# Add search component as a subproject.
set(FAST_DOWNWARD_MAIN_CMAKELISTS_READ TRUE)
add_subdirectory(preprocess_h2)
add_subdirectory(search)
20 changes: 0 additions & 20 deletions src/preprocess_h2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
if(NOT FAST_DOWNWARD_MAIN_CMAKELISTS_READ)
message(
FATAL_ERROR
"Run cmake on the CMakeLists.txt in the 'src' directory. "
"Please delete CMakeCache.txt from the current directory "
"and restart cmake.")
endif()

project(preprocess-h2 LANGUAGES CXX)

set(PREPROCESS_SOURCES
Expand Down Expand Up @@ -59,13 +51,6 @@ macro(fast_downward_set_compiler_flags)
set(CMAKE_CXX_FLAGS_PROFILE "-O3 -pg")
elseif(MSVC)
check_and_set_compiler_flag( "/std:c++20" )
# We force linking to be static on Windows because this makes compiling OSI simpler
# (dynamic linking would require DLLs for OSI). On Windows this is a compiler
# setting, not a linker setting.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
string(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")

# Enable exceptions.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
Expand Down Expand Up @@ -93,11 +78,6 @@ macro(fast_downward_set_compiler_flags)
# "unreferenced local function has been removed";
# see http://stackoverflow.com/questions/3051992/compiler-warning-at-c-template-base-class
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4505")

# TODO: Configuration-specific flags. We currently rely on the fact that
# CMAKE_CXX_FLAGS_RELEASE and CMAKE_CXX_FLAGS_DEBUG get reasonable settings
# from cmake. This is the case for most build environments, but we have less
# control over the way the binary is created.
else()
message(FATAL_ERROR "Unsupported compiler: ${CMAKE_CXX_COMPILER}")
endif()
Expand Down

0 comments on commit d903c17

Please sign in to comment.