Skip to content

Commit 7b8a40f

Browse files
committed
Attempt to fix linux tests
1 parent b36e847 commit 7b8a40f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

scripts/RunTests.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from os import chdir, environ
1010
from shutil import rmtree
1111
import subprocess
12+
import platform
1213

1314
#
1415

@@ -44,7 +45,11 @@ def run_command(command, workingDir):
4445

4546
environ["MP_PERFETTO_SHOULD_BE_ON"] = "FALSE"
4647

47-
run_command (command=f"cmake -B {BUILD_DIR}",
48+
# Single-config generators (Unix Makefiles, Ninja) require CMAKE_BUILD_TYPE at configure time
49+
# Multi-config generators (Xcode, Visual Studio) ignore it and use --config at build time
50+
build_type_flag = "" if platform.system() == "Windows" else " -DCMAKE_BUILD_TYPE=Debug"
51+
52+
run_command (command=f"cmake -B {BUILD_DIR}{build_type_flag}",
4853
workingDir=REPO_ROOT)
4954

5055
run_command (command=f"cmake --build {BUILD_DIR}",
@@ -55,7 +60,7 @@ def run_command(command, workingDir):
5560

5661
environ["MP_PERFETTO_SHOULD_BE_ON"] = "TRUE"
5762

58-
run_command (command=f"cmake -B {BUILD_DIR} -D PERFETTO=ON",
63+
run_command (command=f"cmake -B {BUILD_DIR} -D PERFETTO=ON{build_type_flag}",
5964
workingDir=REPO_ROOT)
6065

6166
run_command (command=f"cmake --build {BUILD_DIR}",

tests/AddSubdirectory/AddTests.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ add_test (NAME "${base_name}.configure"
66
COMMAND "${CMAKE_COMMAND}"
77
-S "${CMAKE_CURRENT_LIST_DIR}"
88
-B "${binary_dir}"
9+
-G "${CMAKE_GENERATOR}"
10+
-D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
911
-D "MELATONIN_PERFETTO_ROOT=${MelatoninPerfetto_SOURCE_DIR}"
1012
-D "FETCHCONTENT_SOURCE_DIR_JUCE=${juce_SOURCE_DIR}"
1113
-D "FETCHCONTENT_SOURCE_DIR_PERFETTO=${perfetto_SOURCE_DIR}")

tests/FindPackage/AddTests.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_test (NAME "${base_name}.configure"
1717
-S "${CMAKE_CURRENT_LIST_DIR}"
1818
-B "${binary_dir}"
1919
-G "${CMAKE_GENERATOR}"
20+
-D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
2021
-D "MelatoninPerfetto_DIR=${prefix}/${CMAKE_INSTALL_LIBDIR}/cmake/melatonin_perfetto"
2122
-D "FETCHCONTENT_SOURCE_DIR_JUCE=${juce_SOURCE_DIR}"
2223
-D "FETCHCONTENT_SOURCE_DIR_PERFETTO=${perfetto_SOURCE_DIR}")

0 commit comments

Comments
 (0)