From 513b00a30e4b25a53b80d366dc5bbee067a863d8 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 5 Jan 2023 14:26:17 +0100 Subject: [PATCH] cmake: update for MSVC_IDE --- CMakeLists.txt | 16 +++++++++------- src/Makefile | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 531d55de..852df126 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,14 +24,16 @@ option(UPX_CONFIG_DISABLE_SELF_PACK_TEST "Do not test packing UPX with itself" O # Disallow in-source builds. Note that you will still have to manually # clean up a few files if you accidentally try an in-source build. -set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) -set(CMAKE_DISABLE_SOURCE_CHANGES ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -if(",${CMAKE_SOURCE_DIR}," STREQUAL ",${CMAKE_BINARY_DIR},") - message(FATAL_ERROR "ERROR: In-source builds are not allowed, please use an extra build dir.") +if(NOT MSVC_IDE) + set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + set(CMAKE_DISABLE_SOURCE_CHANGES ON) + if(",${CMAKE_CURRENT_SOURCE_DIR}," STREQUAL ",${CMAKE_CURRENT_BINARY_DIR},") + message(FATAL_ERROR "ERROR: In-source builds are not allowed, please use an extra build dir.") + endif() endif() -set(CMAKE_C_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # determine git revision set(GITREV_SHORT "") diff --git a/src/Makefile b/src/Makefile index ca31efad..2925c415 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,6 +36,7 @@ $(top_srcdir)/build/release/upx: PHONY $(MAKE) -C $(top_srcdir) build/release .PHONY: PHONY +.NOTPARALLEL: # # "make run-testsuite"