diff --git a/include/bx/thread.h b/include/bx/thread.h index 0cdc1f4..532ae87 100644 --- a/include/bx/thread.h +++ b/include/bx/thread.h @@ -161,7 +161,11 @@ namespace bx prctl(PR_SET_NAME,_name, 0, 0, 0); # endif // defined(__GLIBC__) ... #elif BX_PLATFORM_BSD +#ifdef __NetBSD__ + pthread_setname_np(m_handle, "%s", (void *)_name); +#else pthread_setname_np(m_handle, _name); +#endif #elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC # pragma pack(push, 8) struct ThreadName diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index a939fbf..77e7132 100755 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -13,31 +13,30 @@ function toolchain(_buildDir, _libDir) value = "GCC", description = "Choose GCC flavor", allowed = { - { "android-arm", "Android - ARM" }, - { "android-mips", "Android - MIPS" }, - { "android-x86", "Android - x86" }, - { "asmjs", "Emscripten/asm.js" }, - { "freebsd", "FreeBSD" }, - { "ios-arm", "iOS - ARM" }, - { "ios-simulator", "iOS - Simulator" }, - { "linux-gcc", "Linux (GCC compiler)" }, - { "linux-gcc-5", "Linux (GCC-5 compiler)" }, - { "linux-clang", "Linux (Clang compiler)" }, - { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" }, - { "linux-arm-gcc", "Linux (ARM, GCC compiler)" }, - { "linux-steamlink", "Steam Link" }, - { "tvos-arm64", "tvOS - ARM64" }, - { "tvos-simulator", "tvOS - Simulator" }, - { "mingw-gcc", "MinGW" }, - { "mingw-clang", "MinGW (clang compiler)" }, - { "nacl", "Native Client" }, - { "nacl-arm", "Native Client - ARM" }, - { "osx", "OSX" }, - { "pnacl", "Native Client - PNaCl" }, - { "ps4", "PS4" }, - { "qnx-arm", "QNX/Blackberry - ARM" }, - { "rpi", "RaspberryPi" }, - { "riscv", "RISC-V" }, + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "linux-gcc", "Linux (GCC compiler)" }, + { "linux-gcc-5", "Linux (GCC-5 compiler)" }, + { "linux-clang", "Linux (Clang compiler)" }, + { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" }, + { "linux-arm-gcc", "Linux (ARM, GCC compiler)" }, + { "ios-arm", "iOS - ARM" }, + { "ios-simulator", "iOS - Simulator" }, + { "tvos-arm64", "tvOS - ARM64" }, + { "tvos-simulator", "tvOS - Simulator" }, + { "mingw-gcc", "MinGW" }, + { "mingw-clang", "MinGW (clang compiler)" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "netbsd", "NetBSD" }, + { "osx", "OSX" }, + { "pnacl", "Native Client - PNaCl" }, + { "ps4", "PS4" }, + { "qnx-arm", "QNX/Blackberry - ARM" }, + { "rpi", "RaspberryPi" }, }, } @@ -283,6 +282,9 @@ function toolchain(_buildDir, _libDir) premake.gcc.ar = naclToolchain .. "ar" location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm")) + elseif "netbsd" == _OPTIONS["gcc"] then + location (path.join(_buildDir, "projects", _ACTION .. "-netbsd")) + elseif "osx" == _OPTIONS["gcc"] then if os.is("linux") then @@ -948,6 +950,14 @@ function toolchain(_buildDir, _libDir) "NOMINMAX", } + configuration { "netbsd" } + targetdir (path.join(_buildDir, "netbsd/bin")) + objdir (path.join(_buildDir, "netbsd/obj")) + libdirs { path.join(_libDir, "lib/netbsd") } + includedirs { + path.join(bxDir, "include/compat/freebsd"), + } + configuration { "osx", "x32" } targetdir (path.join(_buildDir, "osx32_clang/bin")) objdir (path.join(_buildDir, "osx32_clang/obj"))