build: Cleanup QNX build
authorJuan Ramos <juan@lunarg.com>
Wed, 25 Oct 2023 18:08:41 +0000 (12:08 -0600)
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>
Wed, 25 Oct 2023 19:02:08 +0000 (13:02 -0600)
Move QNX build scripts into the scripts directory. This is
consistent with how we deal with the chromium build.

Provide a useful error to CMake users trying to cross-compile
for QNX. Although CMake does support QNX we want to point users
to the official method.

23 files changed:
.gitignore
BUILD.md
CMakeLists.txt
build-qnx/Makefile [deleted file]
build-qnx/common.mk [deleted file]
build-qnx/loader_cmake_config.h [deleted file]
build-qnx/nto/Makefile [deleted file]
build-qnx/nto/aarch64/Makefile [deleted file]
build-qnx/nto/aarch64/so.le/Makefile [deleted file]
build-qnx/nto/arm/Makefile [deleted file]
build-qnx/nto/arm/so.le.v7/Makefile [deleted file]
build-qnx/nto/x86_64/Makefile [deleted file]
build-qnx/nto/x86_64/so/Makefile [deleted file]
scripts/qnx/Makefile [new file with mode: 0644]
scripts/qnx/common.mk [new file with mode: 0644]
scripts/qnx/loader_cmake_config.h [new file with mode: 0644]
scripts/qnx/nto/Makefile [new file with mode: 0644]
scripts/qnx/nto/aarch64/Makefile [new file with mode: 0644]
scripts/qnx/nto/aarch64/so.le/Makefile [new file with mode: 0644]
scripts/qnx/nto/arm/Makefile [new file with mode: 0644]
scripts/qnx/nto/arm/so.le.v7/Makefile [new file with mode: 0644]
scripts/qnx/nto/x86_64/Makefile [new file with mode: 0644]
scripts/qnx/nto/x86_64/so/Makefile [new file with mode: 0644]

index e8c25f2acc13a523e294c5d99dc8d2fafa4c8051..69e409b96c09d68833bfb58984a6b68409c9ac0e 100644 (file)
@@ -1,3 +1,9 @@
+# By default we install dependencies to the external directory
+/external/*
+
+# Ignore any build directories
+*build*/
+
 CMakeCache.txt
 CMakeLists.txt.user
 CMakeFiles/
@@ -5,12 +11,7 @@ cmake_install.cmake
 Makefile
 scripts/__pycache__
 VKConfig.h
-build
-build32
-dbuild
-external/*
-!external/CMakeLists.txt
-!external/README.md
+
 *.so
 *.so.*
 *.pyc
index 064b0b6791bd6699bf7f6578bb25152fab67ec4b..1871851e2f6dc93eae53bceaaeffac3dc8438179 100644 (file)
--- a/BUILD.md
+++ b/BUILD.md
@@ -603,7 +603,7 @@ QNX is using its own build system. The proper build environment must be set
 under the QNX host development system (Linux, Win64, MacOS) by invoking
 the shell/batch script provided with QNX installation.
 
-Then change working directory to the "build-qnx" in this project and type "make".
+Then change working directory to the "scripts/qnx" in this project and type "make".
 It will build the ICD loader for all CPU targets supported by QNX.
 
 ## Cross Compilation
index bfa48440519366543a573c50e28c1e770f6a07a3..71e7b5b3d94e35bb1222166469a53728f342ffa0 100644 (file)
@@ -111,7 +111,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU")
     option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
     option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
     option(BUILD_WSI_DIRECTFB_SUPPORT "Build DirectFB WSI support" OFF)
-    option(BUILD_WSI_SCREEN_QNX_SUPPORT "Build QNX Screen WSI support" OFF)
 
     find_package(PkgConfig REQUIRED QUIET) # Use PkgConfig to find Linux system libraries
 
@@ -133,10 +132,8 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU")
         target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_DIRECTFB_EXT)
         target_link_libraries(platform_wsi INTERFACE PkgConfig::DirectFB)
     endif()
-    if(BUILD_WSI_SCREEN_QNX_SUPPORT)
-        # Part of OS, no additional include directories are required
-        target_compile_definitions(platform_wsi INTERFACE VK_USE_PLATFORM_SCREEN_QNX)
-    endif()
+elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
+    message(FATAL_ERROR "See BUILD.md for QNX build")
 else()
     message(FATAL_ERROR "Unsupported Platform!")
 endif()
diff --git a/build-qnx/Makefile b/build-qnx/Makefile
deleted file mode 100644 (file)
index 3beecfb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-LIST=OS
-include recurse.mk
diff --git a/build-qnx/common.mk b/build-qnx/common.mk
deleted file mode 100644 (file)
index 16f68f1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-ifndef QCONFIG
-QCONFIG=qconfig.mk
-endif
-include $(QCONFIG)
-
-define PINFO
-PINFO DESCRIPTION = "Vulkan ICD Loader"
-endef
-
-ICD_ROOT=$(CURDIR)/../../../..
-
-EXTRA_INCVPATH+=$(ICD_ROOT)/build_qnx
-EXTRA_INCVPATH+=$(ICD_ROOT)/external/Vulkan-Headers/include
-
-EXTRA_SRCVPATH+=$(ICD_ROOT)/loader
-EXTRA_SRCVPATH+=$(ICD_ROOT)/loader/generated
-
-SO_VERSION=1
-NAME=vulkan
-
-# Make the library
-
-SRCS = cJSON.c debug_utils.c dev_ext_trampoline.c loader.c \
-       phys_dev_ext.c trampoline.c unknown_ext_chain.c wsi.c \
-       extension_manual.c unknown_function_handling.c settings.c \
-       log.c allocation.c loader_environment.c gpa_helper.c \
-       terminator.c
-
-LDFLAGS += -Wl,--unresolved-symbols=report-all -Wl,--no-undefined -Wl,-fPIC
-
-include $(MKFILES_ROOT)/qtargets.mk
-
-CCFLAGS += -DVK_USE_PLATFORM_SCREEN_QNX=1 -Dvulkan_EXPORTS
-CCFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
-CCFLAGS += -fno-strict-aliasing -fno-builtin-memcmp -Wno-stringop-truncation
-CCFLAGS += -Wno-stringop-overflow -fvisibility=hidden
-CCFLAGS += -Wpointer-arith -fPIC
-
-# Enable this if required
-CCFLAGS += -DVK_ENABLE_BETA_EXTENSIONS
-
-CXXFLAGS += $(CCFLAGS)
-
-# cJSON requires math library for pow() function
-LIBS += m
-
-INSTALLDIR=usr/lib
diff --git a/build-qnx/loader_cmake_config.h b/build-qnx/loader_cmake_config.h
deleted file mode 100644 (file)
index 37d318f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#undef HAVE_SECURE_GETENV
-#undef HAVE___SECURE_GETENV
diff --git a/build-qnx/nto/Makefile b/build-qnx/nto/Makefile
deleted file mode 100644 (file)
index 0cc5eae..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=CPU
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/build-qnx/nto/aarch64/Makefile b/build-qnx/nto/aarch64/Makefile
deleted file mode 100644 (file)
index 0e22650..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/build-qnx/nto/aarch64/so.le/Makefile b/build-qnx/nto/aarch64/so.le/Makefile
deleted file mode 100644 (file)
index 0f9d7b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include ../../../common.mk
diff --git a/build-qnx/nto/arm/Makefile b/build-qnx/nto/arm/Makefile
deleted file mode 100644 (file)
index 0e22650..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/build-qnx/nto/arm/so.le.v7/Makefile b/build-qnx/nto/arm/so.le.v7/Makefile
deleted file mode 100644 (file)
index 0f9d7b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include ../../../common.mk
diff --git a/build-qnx/nto/x86_64/Makefile b/build-qnx/nto/x86_64/Makefile
deleted file mode 100644 (file)
index 0e22650..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/build-qnx/nto/x86_64/so/Makefile b/build-qnx/nto/x86_64/so/Makefile
deleted file mode 100644 (file)
index 0f9d7b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include ../../../common.mk
diff --git a/scripts/qnx/Makefile b/scripts/qnx/Makefile
new file mode 100644 (file)
index 0000000..3beecfb
--- /dev/null
@@ -0,0 +1,2 @@
+LIST=OS
+include recurse.mk
diff --git a/scripts/qnx/common.mk b/scripts/qnx/common.mk
new file mode 100644 (file)
index 0000000..f226f64
--- /dev/null
@@ -0,0 +1,44 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+define PINFO
+PINFO DESCRIPTION = "Vulkan ICD Loader"
+endef
+
+ICD_ROOT=$(CURDIR)/../../../../..
+
+EXTRA_INCVPATH+=$(ICD_ROOT)/scripts/gn
+EXTRA_INCVPATH+=$(ICD_ROOT)/external/Vulkan-Headers/include
+
+EXTRA_SRCVPATH+=$(ICD_ROOT)/loader
+EXTRA_SRCVPATH+=$(ICD_ROOT)/loader/generated
+
+SO_VERSION=1
+NAME=vulkan
+
+# Make the library
+
+SRCS = cJSON.c debug_utils.c dev_ext_trampoline.c loader.c \
+       phys_dev_ext.c trampoline.c unknown_ext_chain.c wsi.c \
+       extension_manual.c unknown_function_handling.c settings.c \
+       log.c allocation.c loader_environment.c gpa_helper.c \
+       terminator.c
+
+LDFLAGS += -Wl,--unresolved-symbols=report-all -Wl,--no-undefined -Wl,-fPIC
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+CCFLAGS += -DVK_USE_PLATFORM_SCREEN_QNX=1 -DVK_ENABLE_BETA_EXTENSIONS
+CCFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
+CCFLAGS += -fno-strict-aliasing -fno-builtin-memcmp -Wno-stringop-truncation
+CCFLAGS += -Wno-stringop-overflow -fvisibility=hidden
+CCFLAGS += -Wpointer-arith -fPIC
+
+CXXFLAGS += $(CCFLAGS)
+
+# cJSON requires math library for pow() function
+LIBS += m
+
+INSTALLDIR=usr/lib
diff --git a/scripts/qnx/loader_cmake_config.h b/scripts/qnx/loader_cmake_config.h
new file mode 100644 (file)
index 0000000..37d318f
--- /dev/null
@@ -0,0 +1,2 @@
+#undef HAVE_SECURE_GETENV
+#undef HAVE___SECURE_GETENV
diff --git a/scripts/qnx/nto/Makefile b/scripts/qnx/nto/Makefile
new file mode 100644 (file)
index 0000000..0cc5eae
--- /dev/null
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/scripts/qnx/nto/aarch64/Makefile b/scripts/qnx/nto/aarch64/Makefile
new file mode 100644 (file)
index 0000000..0e22650
--- /dev/null
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/scripts/qnx/nto/aarch64/so.le/Makefile b/scripts/qnx/nto/aarch64/so.le/Makefile
new file mode 100644 (file)
index 0000000..0f9d7b9
--- /dev/null
@@ -0,0 +1 @@
+include ../../../common.mk
diff --git a/scripts/qnx/nto/arm/Makefile b/scripts/qnx/nto/arm/Makefile
new file mode 100644 (file)
index 0000000..0e22650
--- /dev/null
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/scripts/qnx/nto/arm/so.le.v7/Makefile b/scripts/qnx/nto/arm/so.le.v7/Makefile
new file mode 100644 (file)
index 0000000..0f9d7b9
--- /dev/null
@@ -0,0 +1 @@
+include ../../../common.mk
diff --git a/scripts/qnx/nto/x86_64/Makefile b/scripts/qnx/nto/x86_64/Makefile
new file mode 100644 (file)
index 0000000..0e22650
--- /dev/null
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
diff --git a/scripts/qnx/nto/x86_64/so/Makefile b/scripts/qnx/nto/x86_64/so/Makefile
new file mode 100644 (file)
index 0000000..0f9d7b9
--- /dev/null
@@ -0,0 +1 @@
+include ../../../common.mk