From d903c17a722536121e79cee661e344d64c3c3995 Mon Sep 17 00:00:00 2001 From: Jendrik Seipp Date: Tue, 3 Oct 2023 11:19:31 +0200 Subject: [PATCH] Link dynamically on Windows. --- .github/workflows/windows.yml | 12 ++---------- src/CMakeLists.txt | 1 - src/preprocess_h2/CMakeLists.txt | 20 -------------------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a20458d78..7a3b9481d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a2b0efc21..a4c5b89bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/preprocess_h2/CMakeLists.txt b/src/preprocess_h2/CMakeLists.txt index aa85ea38e..43535e170 100644 --- a/src/preprocess_h2/CMakeLists.txt +++ b/src/preprocess_h2/CMakeLists.txt @@ -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 @@ -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") @@ -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()